From 9208da738bf0cf86d44e29201a295a6a3d986d21 Mon Sep 17 00:00:00 2001 From: treychaffin Date: Tue, 26 Mar 2024 14:04:05 -0500 Subject: [PATCH] modified close method according to recommendation in asyncio docs, resolved TypeError --- 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