gh-140530: fix a reference leak in an error path for `raise exc from … · python/cpython@0c77e7c · GitHub
Skip to content

Commit 0c77e7c

Browse files
authored
gh-140530: fix a reference leak in an error path for raise exc from cause (#140908)
Fix a reference leak in `raise E from T` when `T` is an exception subtype for which `T.__new__` does not return an exception instance.
1 parent 5ba0a1a commit 0c77e7c

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

Lib/test/test_raise.py

Lines changed: 7 additions & 11 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a reference leak when ``raise exc from cause`` fails. Patch by Bénédikt
2+
Tran.

Python/ceval.c

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)