summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2023-10-16 14:39:23 (GMT)
committerGitHub <noreply@github.com>2023-10-16 14:39:23 (GMT)
commitb3c9faf056e7d642785a8cfd53d1184b37a74a69 (patch)
treec5b28ce7d3739b7968cd00465feb7683dc1f6961 /Python/pythonrun.c
parentbad7a35055dbe9e6297110eb8c72eb8edfefd42d (diff)
downloadcpython-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.c5
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");