We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f280a56 commit 0a49130Copy full SHA for 0a49130
asyncpg/protocol/protocol.pyx
@@ -503,8 +503,8 @@ cdef class BaseProtocol(CoreProtocol):
503
self.timeout_handle = None
504
505
if self.cancel_waiter is not None:
506
- if self.waiter is None or not self.waiter.cancelled():
507
- self.cancel_waiter.set_result(
+ if self.waiter is not None and not self.waiter.done():
+ self.cancel_waiter.set_exception(
508
RuntimeError('invalid state after cancellation'))
509
else:
510
self.cancel_waiter.set_result(None)
0 commit comments