Commit b05e0b27 authored by oroulet's avatar oroulet Committed by oroulet

sync api: make sure threadloop is stopped even if disconnect failes

parent ecc3b1ad
......@@ -174,9 +174,11 @@ class Client:
pass
def disconnect(self):
self.tloop.post(self.aio_obj.disconnect())
if self.close_tloop:
self.tloop.stop()
try:
self.tloop.post(self.aio_obj.disconnect())
finally:
if self.close_tloop:
self.tloop.stop()
def set_user(self, username: str):
self.aio_obj.set_user(username)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment