]> granicus.if.org Git - python/commitdiff
Issue #18408: Fix PyEval_EvalFrameEx() for MemoryError
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 15 Jul 2013 19:16:27 +0000 (21:16 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 15 Jul 2013 19:16:27 +0000 (21:16 +0200)
Don't pass a NULL traceback to PyException_SetTraceback(): pass Py_None.
Passing NULL would raise a new exception.

Python/ceval.c

index 61928e39fe7722056de16387faa5ead670483fea..5a35524a247117c69d114a9879d3f966ce6018b1 100644 (file)
@@ -3090,7 +3090,10 @@ fast_block_end:
                    Python main loop. */
                 PyErr_NormalizeException(
                     &exc, &val, &tb);
-                PyException_SetTraceback(val, tb);
+                if (tb != NULL)
+                    PyException_SetTraceback(val, tb);
+                else
+                    PyException_SetTraceback(val, Py_None);
                 Py_INCREF(exc);
                 tstate->exc_type = exc;
                 Py_INCREF(val);