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

#12026 Suppress a deprecation warning on Python 3.12 #12028

Closed
wants to merge 1 commit into from

Conversation

AdamWill
Copy link
Contributor

The three-arg form of generator.throw() was deprecated in Python 3.12. However, we're not sure if the modern one-arg form works on Python 3.8, which is still supported, so instead of changing it right now, this just suppresses the warning.

Scope and purpose

Fixes #12026 (use of a deprecated form of generator.throw() causes deprecation warnings on Python 3.12). An alternative to #12027 - this one just suppresses the warning, rather than changing the call. @glyph asked me to submit both options.

Contributor Checklist: (done)

The three-arg form of generator.throw() was deprecated in Python
3.12. However, we're not sure if the modern one-arg form works
on Python 3.8, which is still supported, so instead of changing
it right now, this just suppresses the warning.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
@AdamWill
Copy link
Contributor Author

@glyph asked for both choices in the issue, so I provided both choices. There's an open question about exactly what happens when you pass a single arg that's an instance (not a type) on Python 3.8 - see python/cpython#96348 .

@adiroiban
Copy link
Member

Thanks Adam for the PR.

I am join to close this for now, I hope we can have #12027 merged

@adiroiban adiroiban closed this Oct 31, 2023
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.

twisted uses deprecated three-argument form of generator.throw
2 participants