mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#3663: extra DECREF on syntax errors.
Patch by Amaury Forgeot d'Arc, reviewed by Benjamin Peterson.
This commit is contained in:
parent
2b9e040091
commit
e2dffc0aeb
2 changed files with 6 additions and 1 deletions
|
@ -12,6 +12,8 @@ What's New in Python 3.0 release candidate 1
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #3663: Py_None was decref'd when printing SyntaxErrors.
|
||||||
|
|
||||||
- Issue #3657: Fix uninitialized memory read when pickling longs.
|
- Issue #3657: Fix uninitialized memory read when pickling longs.
|
||||||
Found by valgrind.
|
Found by valgrind.
|
||||||
|
|
||||||
|
|
|
@ -1242,7 +1242,10 @@ PyErr_PrintEx(int set_sys_last_vars)
|
||||||
if (exception == NULL)
|
if (exception == NULL)
|
||||||
return;
|
return;
|
||||||
PyErr_NormalizeException(&exception, &v, &tb);
|
PyErr_NormalizeException(&exception, &v, &tb);
|
||||||
tb = tb ? tb : Py_None;
|
if (tb == NULL) {
|
||||||
|
tb = Py_None;
|
||||||
|
Py_INCREF(tb);
|
||||||
|
}
|
||||||
PyException_SetTraceback(v, tb);
|
PyException_SetTraceback(v, tb);
|
||||||
if (exception == NULL)
|
if (exception == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue