Swap (and correct) error check

This commit is contained in:
Lonami 2018-06-17 18:14:17 +02:00 committed by GitHub
parent d9b8c1b0be
commit a265a3f165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,10 +158,10 @@ class MTProtoSender:
self._recv_loop_handle.cancel()
__log__.info('Disconnection from {} complete!'.format(self._ip))
if error is not None:
self._connection_dropped.set_result(None)
else:
if error:
self._connection_dropped.set_exception(error)
else:
self._connection_dropped.set_result(None)
def send(self, request, ordered=False):
"""