From e0a516005b1d08c60e4abbc0f0d5eac55493eab2 Mon Sep 17 00:00:00 2001 From: Trey Chaffin <73377516+treychaffin@users.noreply.github.com> Date: Sat, 30 Mar 2024 11:58:17 -0500 Subject: [PATCH] modify close method according to asyncio docs, resolve TypeError (#112) --- alicat/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alicat/util.py b/alicat/util.py index c9d4357..48b07db 100644 --- a/alicat/util.py +++ b/alicat/util.py @@ -181,7 +181,8 @@ async def _handle_communication(self, command: str) -> Optional[str]: async def close(self) -> None: """Close the TCP connection.""" if self.open: - await self.connection['writer'].close() + self.connection['writer'].close() + await self.connection['writer'].wait_closed() self.open = False