bpo-32684: Fix gather to propagate cancel of itself with return_exceptions#7209
bpo-32684: Fix gather to propagate cancel of itself with return_exceptions#72091st1 merged 2 commits intopython:masterfrom
Conversation
| for child in self._children: | ||
| if child.cancel(): | ||
| ret = True | ||
| if ret: |
There was a problem hiding this comment.
I don't follow why future cancellation should be propagated but if children are tasks nothing should be done.
There was a problem hiding this comment.
See https://bugs.python.org/issue26923 and, specifically, Task.cancel(): if the task is done/cancelled, we don't raise CancelledError. Similarly for gather(), if all of its tasks are already done, we don't raise it.
This seems to be a super rare edge case.
|
Thanks @1st1 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
|
GH-7222 is a backport of this pull request to the 3.7 branch. |
…tions (pythonGH-7209) (cherry picked from commit 863b674) Co-authored-by: Yury Selivanov <yury@magic.io>
|
Sorry, @1st1, I could not cleanly backport this to |
|
3.6 PR: #7224 |
https://bugs.python.org/issue32684