commit | edad4d89e357c92f70c0324b937845d652b20afd | [log] [tgz] |
---|---|---|
author | Yury Selivanov <yury@edgedb.com> | Wed Sep 25 03:32:08 2019 -0700 |
committer | Carol Willing <carolcode@willingconsulting.com> | Wed Sep 25 03:32:08 2019 -0700 |
tree | 98cea6eaaf38962883784942aba23160b009360f | |
parent | c64af8fad3c4f5751af624647fbb0ce023f525dc [diff] [blame] |
bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)
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 @@ 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: