Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0702858

Browse files
committed
Missing DECREFs when exception is raised in sys.excepthook.
Bug fix candidate for 2.1 branch. (I imagine the other recent leak patches are bug fix candidates, too, but I forgot to mark mine as such.)
1 parent 038215a commit 0702858

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Python/pythonrun.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,9 @@ PyErr_PrintEx(int set_sys_last_vars)
895895
PyErr_Display(exception2, v2, tb2);
896896
PySys_WriteStderr("\nOriginal exception was:\n");
897897
PyErr_Display(exception, v, tb);
898+
Py_XDECREF(exception2);
899+
Py_XDECREF(v2);
900+
Py_XDECREF(tb2);
898901
}
899902
Py_XDECREF(result);
900903
Py_XDECREF(args);

0 commit comments

Comments
 (0)