Skip to content

Commit

Permalink
twisted#12026 Adjust to deprecation of 3-arg generator.throw() (twist…
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Dec 29, 2023
2 parents 68f112f + 2280e5f commit 88151eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/twisted/newsfragments/12026.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
twisted.python.failure.Failure now throws exception for generators without triggering a deprecation warnings on Python 3.12.
2 changes: 1 addition & 1 deletion src/twisted/python/failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 88151eb

Please sign in to comment.