another resource warning

This commit is contained in:
Kovid Goyal 2021-06-24 22:16:35 +05:30
parent ffb77face1
commit b8ec9c5809
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -89,7 +89,8 @@ class Check(Command):
self.wn_path = os.path.expanduser('~/work/srv/main/static') self.wn_path = os.path.expanduser('~/work/srv/main/static')
self.has_changelog_check = os.path.exists(self.wn_path) self.has_changelog_check = os.path.exists(self.wn_path)
try: try:
cache = json.load(open(self.cache_file, 'rb')) with open(self.cache_file, 'rb') as f:
cache = json.load(f)
except EnvironmentError as err: except EnvironmentError as err:
if err.errno != errno.ENOENT: if err.errno != errno.ENOENT:
raise raise