diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-03-29 22:38:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 22:38:51 (GMT) |
commit | 09b90a037d18f5d4acdf1b14082e57bda78e85d3 (patch) | |
tree | dcdab5633c14b61546e3de07c232af3b5c379f83 /Python | |
parent | c8b5738810516df5722caf049003e9b319427bec (diff) | |
download | cpython-09b90a037d18f5d4acdf1b14082e57bda78e85d3.zip cpython-09b90a037d18f5d4acdf1b14082e57bda78e85d3.tar.gz cpython-09b90a037d18f5d4acdf1b14082e57bda78e85d3.tar.bz2 |
bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pythonrun.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 * |