diff options
author | Ran Benita <ran@unusedvar.com> | 2020-08-02 17:56:36 +0300 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2020-08-06 18:46:17 +0300 |
commit | f8c4e038fde9e58732ef6ffad77cc25d0746cbc3 (patch) | |
tree | 4b6b1a00d631f73cb38ecf6b3423a4e6a2ad1a99 /extra | |
parent | 70f3ad1c1f31b35d4004f92734b4afd6c8fbdecf (diff) | |
download | pytest-f8c4e038fde9e58732ef6ffad77cc25d0746cbc3.tar.gz |
Replace some usages of py.path.local
Diffstat (limited to 'extra')
-rw-r--r-- | extra/get_issues.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/extra/get_issues.py b/extra/get_issues.py index c264b2644..4aaa3c3ec 100644 --- a/extra/get_issues.py +++ b/extra/get_issues.py @@ -1,6 +1,6 @@ import json +from pathlib import Path -import py import requests issues_url = "https://api.github.com/repos/pytest-dev/pytest/issues" @@ -31,12 +31,12 @@ def get_issues(): def main(args): - cachefile = py.path.local(args.cache) + cachefile = Path(args.cache) if not cachefile.exists() or args.refresh: issues = get_issues() - cachefile.write(json.dumps(issues)) + cachefile.write_text(json.dumps(issues), "utf-8") else: - issues = json.loads(cachefile.read()) + issues = json.loads(cachefile.read_text("utf-8")) open_issues = [x for x in issues if x["state"] == "open"] |