Skip to content

Commit 85e7aec

Browse files
authored
Merge pull request #41 from jschlyter/close_file
close file after access
2 parents 63eb236 + ebc9e4f commit 85e7aec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cryptojwt/key_bundle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ def do_local_jwk(self, filename):
290290
291291
:param filename: Name of the file from which the JWKS should be loaded
292292
"""
293-
_info = json.loads(open(filename).read())
293+
with open(filename) as input_file:
294+
_info = json.load(input_file)
294295
if 'keys' in _info:
295296
self.do_keys(_info["keys"])
296297
else:

0 commit comments

Comments
 (0)