discovered and use _compat to_bytes and to_native functions

This commit is contained in:
Radu Ioan Fericean
2018-04-14 14:58:53 +03:00
parent 086bfb5851
commit 0900a3ddb9
3 changed files with 13 additions and 17 deletions
+1 -2
View File
@@ -207,8 +207,7 @@ def secure_dumps(data, encryption_key, hash_key=None, compression_level=None):
def secure_loads(data, encryption_key, hash_key=None, compression_level=None):
if not isinstance(data, bytes):
data = bytes(data, 'utf8')
data = to_bytes(data)
components = data.count(b':')
if components == 1:
return secure_loads_deprecated(data, encryption_key, hash_key, compression_level)