diff --git a/scripts/bootstrap_history.py b/scripts/bootstrap_history.py index dde83dd5c60..87c471a4289 100644 --- a/scripts/bootstrap_history.py +++ b/scripts/bootstrap_history.py @@ -743,8 +743,10 @@ def _releases(): def _github_client(): try: - github_json = os.path.expanduser("~/.github.json") - github = Github(**json.load(open(github_json, "r"))) + github_json_path = os.path.expanduser("~/.github.json") + with open(github_json_path, "r") as fh: + github_json_dict = json.load(fh) + github = Github(**github_json_dict) except Exception: log.exception() github = None