mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
#3663: extra DECREF on syntax errors.
Patch by Amaury Forgeot d'Arc, reviewed by Benjamin Peterson.
This commit is contained in:
@@ -1242,7 +1242,10 @@ PyErr_PrintEx(int set_sys_last_vars)
|
||||
if (exception == NULL)
|
||||
return;
|
||||
PyErr_NormalizeException(&exception, &v, &tb);
|
||||
tb = tb ? tb : Py_None;
|
||||
if (tb == NULL) {
|
||||
tb = Py_None;
|
||||
Py_INCREF(tb);
|
||||
}
|
||||
PyException_SetTraceback(v, tb);
|
||||
if (exception == NULL)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user