mypy, read explicitly as binary

This commit is contained in:
Salvo 'LtWorf' Tomaselli 2017-08-18 07:39:49 +02:00
parent 2a86d52c00
commit b8152e2d23
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF

View File

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