]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue 22906: Increment refcount after PyException_SetContext
authorYury Selivanov <yselivanov@sprymix.com>
Sat, 9 May 2015 18:04:17 +0000 (14:04 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Sat, 9 May 2015 18:04:17 +0000 (14:04 -0400)
Objects/genobject.c

index 5ae8512f540418646f5fbb459cd59133ea4215fd..149e545ec066c7b78098e693789c2b615c205785 100644 (file)
@@ -151,6 +151,7 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
             PyErr_NormalizeException(&exc, &val2, &tb);
             PyException_SetCause(val2, val);
             PyException_SetContext(val2, val);
+            Py_INCREF(val);
             PyErr_Restore(exc, val2, tb);
         }
     }