Fix cyclic import and lint

This commit is contained in:
NIC619
2019-07-29 12:42:13 +08:00
parent a4a0d79f6d
commit 2d4e23cfe2
13 changed files with 87 additions and 48 deletions

View File

@ -86,5 +86,5 @@ def id_from_private_key(key: RsaKey) -> ID:
def digest(data: Union[str, bytes]) -> bytes:
if not isinstance(data, bytes):
data_bytes = str(data).encode('utf8')
return hashlib.sha1(data_bytes).digest()
data = str(data).encode('utf8')
return hashlib.sha1(data).digest()