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

View File

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