diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2023-10-16 14:39:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-16 14:39:23 (GMT) |
commit | b3c9faf056e7d642785a8cfd53d1184b37a74a69 (patch) | |
tree | c5b28ce7d3739b7968cd00465feb7683dc1f6961 /Python/pythonrun.c | |
parent | bad7a35055dbe9e6297110eb8c72eb8edfefd42d (diff) | |
download | cpython-b3c9faf056e7d642785a8cfd53d1184b37a74a69.zip cpython-b3c9faf056e7d642785a8cfd53d1184b37a74a69.tar.gz cpython-b3c9faf056e7d642785a8cfd53d1184b37a74a69.tar.bz2 |
gh-110912: Correctly display tracebacks for MemoryError exceptions using the traceback module (#110921)
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 7499429..b915c06 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1031,6 +1031,7 @@ error: void _PyErr_Display(PyObject *file, PyObject *unused, PyObject *value, PyObject *tb) { + assert(value != NULL); assert(file != NULL && file != Py_None); if (PyExceptionInstance_Check(value) && tb != NULL && PyTraceBack_Check(tb)) { @@ -1047,10 +1048,6 @@ _PyErr_Display(PyObject *file, PyObject *unused, PyObject *value, PyObject *tb) int unhandled_keyboard_interrupt = _PyRuntime.signals.unhandled_keyboard_interrupt; - if (!value || PyErr_GivenExceptionMatches(value, PyExc_MemoryError)) { - goto fallback; - } - // Try first with the stdlib traceback module PyObject *traceback_module = PyImport_ImportModule("traceback"); |