[Python-checkins] cpython: Issue 22906: Increment refcount after PyException_SetContext

yury.selivanov python-checkins at python.org
Sat May 9 20:09:13 CEST 2015


https://hg.python.org/cpython/rev/5d8bc813d270
changeset:   95934:5d8bc813d270
user:        Yury Selivanov <yselivanov at sprymix.com>
date:        Sat May 09 14:04:17 2015 -0400
summary:
  Issue 22906: Increment refcount after PyException_SetContext

files:
  Objects/genobject.c |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/Objects/genobject.c b/Objects/genobject.c
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -151,6 +151,7 @@
             PyErr_NormalizeException(&exc, &val2, &tb);
             PyException_SetCause(val2, val);
             PyException_SetContext(val2, val);
+            Py_INCREF(val);
             PyErr_Restore(exc, val2, tb);
         }
     }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list