| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -255,6 +255,8 @@ def uncancel(self): | |
| """ | ||
| if self._num_cancels_requested > 0: | ||
| self._num_cancels_requested -= 1 | ||
| if self._num_cancels_requested == 0: | ||
| self._must_cancel = False | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityShouldn't this also clear the cancel message?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI doubt it -- self._cancel_message is never cleared, and it's never used unless self._must_cancel is set.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityOkay – I was just confused by that Py_CLEAR() in the C version, but this explains it.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityOh, you're right, that CLEAR is unnecessary there too. :-)
Sorry, something went wrong.
All reactions
|
||
| return self._num_cancels_requested | ||
|
|
||
| def __eager_start(self): | ||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| Improved behavior of :class:`asyncio.TaskGroup` when an external cancellation | ||
| collides with an internal cancellation. For example, when two task groups | ||
| are nested and both experience an exception in a child task simultaneously, | ||
| it was possible that the outer task group would misbehave, because | ||
| its internal cancellation was swallowed by the inner task group. | ||
|
|
||
| In the case where a task group is cancelled externally and also must | ||
| raise an :exc:`ExceptionGroup`, it will now call the parent task's | ||
| :meth:`~asyncio.Task.cancel` method. This ensures that a | ||
| :exc:`asyncio.CancelledError` will be raised at the next | ||
| :keyword:`await`, so the cancellation is not lost. | ||
|
|
||
| An added benefit of these changes is that task groups now preserve the | ||
| cancellation count (:meth:`asyncio.Task.cancelling`). | ||
|
|
||
| In order to handle some corner cases, :meth:`asyncio.Task.uncancel` may now | ||
| reset the undocumented ``_must_cancel`` flag when the cancellation count | ||
| reaches zero. |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityNice!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.