bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075)

This commit is contained in:
Pablo Galindo 2021-03-29 23:38:51 +01:00 committed by GitHub
parent c8b5738810
commit 09b90a037d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View file

@ -1082,8 +1082,9 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb)
if (file == Py_None) {
return;
}
Py_INCREF(file);
_PyErr_Display(file, exception, value, tb);
Py_DECREF(file);
}
PyObject *