mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)
This commit is contained in:
parent
c64af8fad3
commit
edad4d89e3
4 changed files with 14 additions and 8 deletions
|
@ -284,7 +284,7 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
|
|||
if self._must_cancel:
|
||||
# Task is cancelled right before coro stops.
|
||||
self._must_cancel = False
|
||||
super().set_exception(exceptions.CancelledError())
|
||||
super().cancel()
|
||||
else:
|
||||
super().set_result(exc.value)
|
||||
except exceptions.CancelledError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue