Merge pull request #35 from cmehay/fix

Fix type error for private key loading
This commit is contained in:
Christophe Mehay 2019-12-03 09:21:01 +01:00 committed by GitHub
commit e89a6d7a65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,6 +83,8 @@ class ServicesGroup(object):
key = base64.b64decode(key) key = base64.b64decode(key)
except binascii.Error: except binascii.Error:
pass pass
if isinstance(key, str):
key = key.encode('ascii')
self._onion.set_private_key(key) self._onion.set_private_key(key)
self.imported_key = True self.imported_key = True