mypy, read explicitly as binary

master
Salvo 'LtWorf' Tomaselli 2017-08-18 07:39:49 +07:00
parent 2a86d52c00
commit b8152e2d23
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF
1 changed files with 2 additions and 2 deletions

@ -113,7 +113,7 @@ class UserInterface:
as string.
'''
if filename:
with open(filename, 'w') as f:
with open(filename, 'wb') as f:
pickle.dump(self.relations, f)
return None
return base64.b64encode(pickle.dumps(self.relations)).decode()
@ -130,7 +130,7 @@ class UserInterface:
except:
pass
elif filename:
with open(filename) as f:
with open(filename, 'rb') as f:
self.relations = pickle.load(f)
def session_reset(self) -> None: