From 7a32a592e3b16a5548d7ee9e65e10af0f5ec734d Mon Sep 17 00:00:00 2001 From: Bruce Merry Date: Tue, 22 Oct 2024 11:13:30 +0200 Subject: [PATCH] Update comment explaining need for drain_lock This makes it clear that it can be removed once Python 3.10.8 is the minimum version. --- src/aiokatcp/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aiokatcp/connection.py b/src/aiokatcp/connection.py index 6b8fbcc..ff003c8 100644 --- a/src/aiokatcp/connection.py +++ b/src/aiokatcp/connection.py @@ -180,8 +180,8 @@ def write_message(self, msg: core.Message) -> None: async def drain(self) -> None: """Block until the outgoing write buffer is small enough.""" - # The Python 3.5 implementation of StreamWriter.drain is not reentrant, - # so we use a lock. + # StreamWriter.drain is not reentrant prior to Python 3.10.8, so we use + # a lock (https://github.com/python/cpython/issues/74116). async with self._drain_lock: if not self._writer_closing: try: