mirror of https://github.com/zulip/zulip.git
api/common.py: Ensure that the API key file is closed when we're done with it
(imported from commit 87a0feb52952aa76bec041d032027e7a272156fc)
This commit is contained in:
parent
a09c9de17c
commit
ca723aed43
|
@ -43,7 +43,8 @@ class HumbugAPI(object):
|
|||
if not os.path.exists(api_key_file):
|
||||
raise RuntimeError("api_key not specified and %s does not exist"
|
||||
% (api_key_file,))
|
||||
api_key = file(api_key_file).read().strip()
|
||||
with file(api_key_file, 'r') as f:
|
||||
api_key = f.read().strip()
|
||||
|
||||
self.api_key = api_key
|
||||
self.email = email
|
||||
|
|
Loading…
Reference in New Issue