Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP5:FactoryCandidates
python-Twisted
stop-using-3-arg-throw.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File stop-using-3-arg-throw.patch of Package python-Twisted
From 2280e5fcd0c9e9d34f5b7650c68f19c1498e49cd Mon Sep 17 00:00:00 2001 From: Adam Williamson <awilliam@redhat.com> Date: Fri, 27 Oct 2023 16:56:24 -0700 Subject: [PATCH] #12026 Adjust to deprecation of 3-arg generator.throw() In Python 3.12, the 3-arg signature of generator.throw() is deprecated, you're only supposed to use the 1-arg signature where you pass only an exception instance. I *think* this is the right thing to pass in this case. Signed-off-by: Adam Williamson <awilliam@redhat.com> --- src/twisted/newsfragments/12026.bugfix | 1 + src/twisted/python/failure.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 src/twisted/newsfragments/12026.bugfix diff --git a/src/twisted/newsfragments/12026.bugfix b/src/twisted/newsfragments/12026.bugfix new file mode 100644 index 00000000000..4f06cf79a4a --- /dev/null +++ b/src/twisted/newsfragments/12026.bugfix @@ -0,0 +1 @@ +twisted.python.failure.Failure now throws exception for generators without triggering a deprecation warnings on Python 3.12. diff --git a/src/twisted/python/failure.py b/src/twisted/python/failure.py index ca893ca4c94..c006d555e55 100644 --- a/src/twisted/python/failure.py +++ b/src/twisted/python/failure.py @@ -516,7 +516,7 @@ def throwExceptionIntoGenerator(self, g): """ # Note that the actual magic to find the traceback information # is done in _findFailure. - return g.throw(self.type, self.value, self.tb) + return g.throw(self.value.with_traceback(self.tb)) @classmethod def _findFailure(cls):
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor