summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@edgedb.com>2019-09-25 10:32:08 (GMT)
committerCarol Willing <carolcode@willingconsulting.com>2019-09-25 10:32:08 (GMT)
commitedad4d89e357c92f70c0324b937845d652b20afd (patch)
tree98cea6eaaf38962883784942aba23160b009360f /Lib/asyncio/tasks.py
parentc64af8fad3c4f5751af624647fbb0ce023f525dc (diff)
downloadcpython-edad4d89e357c92f70c0324b937845d652b20afd.zip
cpython-edad4d89e357c92f70c0324b937845d652b20afd.tar.gz
cpython-edad4d89e357c92f70c0324b937845d652b20afd.tar.bz2
bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index a0cb884..38d9827 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -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: