fix new_private_key coro

pull/1/head
Viktor Villainov 2018-09-09 14:41:22 -04:00
parent 7bf9e4f71f
commit 3b4a8074a1
No known key found for this signature in database
GPG Key ID: 8EB38B46F33BAF2F
2 changed files with 3 additions and 6 deletions

View File

@ -1,7 +1,7 @@
__title__ = 'i2plib'
__description__ = 'A modern asynchronous library for building I2P applications.'
__url__ = 'https://github.com/l-n-s/i2plib'
__version__ = '0.0.3'
__version__ = '0.0.4'
__author__ = 'Viktor Villainov'
__author_email__ = 'supervillain@riseup.net'
__license__ = 'MIT'

View File

@ -58,11 +58,8 @@ async def new_private_key(sam_address=i2plib.sam.DEFAULT_ADDRESS, loop=None,
reader, writer = await get_sam_socket(sam_address, loop)
writer.write(i2plib.sam.dest_generate(sig_type))
reply = parse_reply(await reader.read(BUFFER_SIZE))
if reply.ok:
writer.close()
return i2plib.sam.PrivateKey(reply["PRIV"])
else:
raise i2plib.exceptions.SAM_EXCEPTIONS[reply["RESULT"]]()
async def create_session(session_name, sam_address=i2plib.sam.DEFAULT_ADDRESS,
loop=None, session_ready=None, style="STREAM",