Skip to content

Conversation

agronholm
Copy link

@agronholm agronholm commented Jul 30, 2023

This way, the original cancel message, if any, is preserved. This fixes compatibility with AnyIO 4.0.0rc1 which relies on said cancel messages to determine whether it should swallow a cancellation exception or not.

elprans added a commit that referenced this pull request Oct 9, 2023
`wait_for` has been a mess with respect to cancellations
consistently in `asyncio`.  Hopefully the approach taken in
Python 3.12 solves the issues, so adopt that instead of trying
to "fix" `wait_for` with wrappers on older Pythons.  Use `async_timeout`
as a polyfill on pre-3.11 Python.

Closes: #1056
Closes: #1052
Fixes: #955
elprans added a commit that referenced this pull request Oct 9, 2023
`wait_for` has been a mess with respect to cancellations
consistently in `asyncio`.  Hopefully the approach taken in
Python 3.12 solves the issues, so adopt that instead of trying
to "fix" `wait_for` with wrappers on older Pythons.  Use `async_timeout`
as a polyfill on pre-3.11 Python.

Closes: #1056
Closes: #1052
Fixes: #955
@elprans elprans closed this in #1086 Oct 9, 2023
elprans added a commit that referenced this pull request Oct 9, 2023
`wait_for` has been a mess with respect to cancellations
consistently in `asyncio`.  Hopefully the approach taken in
Python 3.12 solves the issues, so adopt that instead of trying
to "fix" `wait_for` with wrappers on older Pythons.  Use `async_timeout`
as a polyfill on pre-3.11 Python.

Closes: #1056
Closes: #1052
Fixes: #955
@agronholm agronholm deleted the keep-cancel-message branch October 9, 2023 18:59
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.

2 participants