commit | 09b90a037d18f5d4acdf1b14082e57bda78e85d3 | [log] [tgz] |
---|---|---|
author | Pablo Galindo <Pablogsal@gmail.com> | Mon Mar 29 23:38:51 2021 +0100 |
committer | GitHub <noreply@github.com> | Mon Mar 29 23:38:51 2021 +0100 |
tree | dcdab5633c14b61546e3de07c232af3b5c379f83 | |
parent | c8b5738810516df5722caf049003e9b319427bec [diff] |
bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075)
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index b562875..1715cde 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c
@@ -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 *