Replace some usages of py.path.local
This commit is contained in:
@@ -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"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user