interface: check if future already done in handle_disconnect
future could get cancelled in network.py in which case set_result raised
This commit is contained in:
@@ -336,7 +336,8 @@ class Interface(Logger):
|
|||||||
self.logger.debug(f"(disconnect) trace for {repr(e)}", exc_info=True)
|
self.logger.debug(f"(disconnect) trace for {repr(e)}", exc_info=True)
|
||||||
finally:
|
finally:
|
||||||
await self.network.connection_down(self)
|
await self.network.connection_down(self)
|
||||||
self.got_disconnected.set_result(1)
|
if not self.got_disconnected.done():
|
||||||
|
self.got_disconnected.set_result(1)
|
||||||
# if was not 'ready' yet, schedule waiting coroutines:
|
# if was not 'ready' yet, schedule waiting coroutines:
|
||||||
self.ready.cancel()
|
self.ready.cancel()
|
||||||
return wrapper_func
|
return wrapper_func
|
||||||
|
|||||||
Reference in New Issue
Block a user