Skip to content

Commit

Permalink
Close a credentials stream (#7)
Browse files Browse the repository at this point in the history
Automatically closes the file stream after a return.
  • Loading branch information
vvorlov authored Jan 26, 2025
1 parent 60ac87e commit 1ac5681
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion requests_cloudkit/cloudkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def get_key(self):
if self.pem:
return self.pem
else:
return open(self.key_file_name).read()
with open(self.key_file_name) as f:
return f.read()

def encode_body(self, body):
"""
Expand Down

0 comments on commit 1ac5681

Please sign in to comment.