mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 03:13:45 +03:00
Don't set the disconnected flag twice
This commit is contained in:
parent
e2fe3eb503
commit
f5bc952309
|
@ -87,10 +87,11 @@ class Connection(abc.ABC):
|
|||
self._disconnect(error=None)
|
||||
|
||||
def _disconnect(self, error):
|
||||
if error:
|
||||
self._disconnected.set_exception(error)
|
||||
else:
|
||||
self._disconnected.set_result(None)
|
||||
if not self._disconnected.done():
|
||||
if error:
|
||||
self._disconnected.set_exception(error)
|
||||
else:
|
||||
self._disconnected.set_result(None)
|
||||
|
||||
while not self._send_queue.empty():
|
||||
self._send_queue.get_nowait()
|
||||
|
|
Loading…
Reference in New Issue
Block a user