Prevent crash when quitting Python module after Node module

This commit is contained in:
Andrew Ferrazzutti 2022-03-21 01:14:52 -04:00
parent dc02fbe33a
commit b9eb4ce0ac
1 changed files with 5 additions and 5 deletions

View File

@ -83,11 +83,11 @@ class RPCClient:
await self.request("register", peer_id=self.config["appservice.address"])
async def disconnect(self) -> None:
assert self._writer is not None
self._writer.write_eof()
await self._writer.drain()
self._writer = None
self._reader = None
if self._writer is not None:
self._writer.write_eof()
await self._writer.drain()
self._writer = None
self._reader = None
@property
def _next_req_id(self) -> int: