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

add ASYNC122 delayed-entry-of-relative-cancelscope #292

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

jakkdl
Copy link
Member

@jakkdl jakkdl commented Sep 18, 2024

fixes #290

It doesn't handle the complex case of

foo = trio.fail_after
bar = foo(5)
trio.sleep(3)
with bar:
  ...

and while it would be possible to error anytime somebody refers to trio.fail_after not directly inside a with call it'd probably mostly just lead to unnecessary false positives.

@jakkdl
Copy link
Member Author

jakkdl commented Sep 18, 2024

The error message could perhaps mention anyio versions as well, in case @agronholm plans on incorporating python-trio/trio#3010 soonish. But regardless it'll give errors for anyio.move_on_after and anyio.fail_after.

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @jakkdl!

@Zac-HD Zac-HD merged commit 990d7fc into python-trio:main Sep 19, 2024
10 checks passed
@jakkdl jakkdl deleted the delayed_entry branch September 19, 2024 10:23
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.

move_on_after / fail_after not immediately entered
2 participants