gh-108042: asyncio/queues: clarify comments by orbisvicis · Pull Request #108066 · python/cpython
Expand Up
@@ -128,8 +128,9 @@ async def put(self, item):
# previous get_nowait call.
pass
if not self.full() and not putter.cancelled():
# We were woken up by get_nowait(), but can't take
# the call. Wake up the next in line.
# We were woken up by get_nowait(), but can't take the
# call. Wake up the next in line. This can happen when
# the putter is set, then the await cancelled.
self._wakeup_next(self._putters)
raise
return self.put_nowait(item)
Expand Down
Expand Up
@@ -166,8 +167,9 @@ async def get(self):
# previous put_nowait call.
pass
if not self.empty() and not getter.cancelled():
# We were woken up by put_nowait(), but can't take
# the call. Wake up the next in line.
# We were woken up by put_nowait(), but can't take the
# call. Wake up the next in line. This can happen when
# the getter is set, then the await cancelled.
self._wakeup_next(self._getters)
raise
return self.get_nowait()
Expand Down