We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba86d35 commit 2cfaac1Copy full SHA for 2cfaac1
Python/pylifecycle.c
@@ -2547,6 +2547,7 @@ _Py_FatalError_PrintExc(PyThreadState *tstate)
2547
if (ferr == NULL || ferr == Py_None) {
2548
/* sys.stderr is not set yet or set to None,
2549
no need to try to display the exception */
2550
+ Py_DECREF(exc);
2551
return 0;
2552
}
2553
@@ -2555,7 +2556,7 @@ _Py_FatalError_PrintExc(PyThreadState *tstate)
2555
2556
PyObject *tb = PyException_GetTraceback(exc);
2557
int has_tb = (tb != NULL) && (tb != Py_None);
2558
Py_XDECREF(tb);
- Py_XDECREF(exc);
2559
2560
2561
/* sys.stderr may be buffered: call sys.stderr.flush() */
2562
PyObject *res = PyObject_CallMethodNoArgs(ferr, &_Py_ID(flush));
0 commit comments