commit | e2dffc0aeb6e03d8e6512a13cb3fe05562f7c655 | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Tue Aug 26 22:02:58 2008 +0000 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Tue Aug 26 22:02:58 2008 +0000 |
tree | b01c31ee5f3b2625cbf01c52b2bea67061c02226 | |
parent | 2b9e040091cbb5e0c1ecd0479cca74d07a0e10d7 [diff] [blame] |
#3663: extra DECREF on syntax errors. Patch by Amaury Forgeot d'Arc, reviewed by Benjamin Peterson.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 1ee062f..39c86e7 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c
@@ -1242,7 +1242,10 @@ 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;