summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/soledad/__init__.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index 5b2f5fc1..3b7aadea 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -356,9 +356,8 @@ class Soledad(object):
def _store_symkey(self):
ciphertext = self._crypto.encrypt_sym(
self._symkey, self._passphrase)
- f = open(self._config.get_secret_path(), 'w')
- f.write(str(ciphertext))
- f.close()
+ with open(self._config.get_secret_path(), 'w') as f:
+ f.write(ciphertext)
#-------------------------------------------------------------------------
# General crypto utility methods.