Skip to content
New issue

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

gh-128340: make asyncio.events.Handle.cancel() atomic #128347

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

graingert
Copy link
Contributor

@graingert graingert commented Dec 30, 2024

Comment on lines 105 to 121
@property
def _cancelled(self):
return self.cancelled()

@property
def _callback(self):
callback_args = self._callback_args
if callback_args is _HANDLE_CANCELLED:
return None
return callback_args[0]

@property
def _args(self):
callback_args = self._callback_args
if callback_args is _HANDLE_CANCELLED:
return None
return callback_args[1]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests access private attributes - I'd rather update those tests. These properties were just to get a PR up and passing CI quickly.

@@ -2016,7 +2016,7 @@ def _run_once(self):
ntodo = len(self._ready)
for i in range(ntodo):
handle = self._ready.popleft()
if handle._cancelled:
if handle.cancelled():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is redundant because _run checks now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant