Skip to content

Commit

Permalink
twisted#12026 Adjust to deprecation of 3-arg generator.throw()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
AdamWill committed Oct 28, 2023
1 parent 157cd8e commit b75acda
Showing 1 changed file with 1 addition and 1 deletion.
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 b75acda

Please sign in to comment.