diff options
author | Yury Selivanov <yury@magic.io> | 2016-11-09 00:04:57 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-11-09 00:04:57 (GMT) |
commit | 692796a948ab67d75f7010e96b31885eefbd88e5 (patch) | |
tree | bf583292027adc5ce87654556095af0326aef95b /Modules/_asynciomodule.c | |
parent | c3d7dbb82122b7bd14da9493d82f6675510f206a (diff) | |
download | cpython-692796a948ab67d75f7010e96b31885eefbd88e5.zip cpython-692796a948ab67d75f7010e96b31885eefbd88e5.tar.gz cpython-692796a948ab67d75f7010e96b31885eefbd88e5.tar.bz2 |
Issue #26081: Fix refleak in _asyncio.Future.__iter__().throw.
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r-- | Modules/_asynciomodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 7df6fa5..df81b10 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -1044,14 +1044,16 @@ FutureIter_throw(futureiterobject *self, PyObject *args) else { if (PyExceptionClass_Check(type)) { val = PyObject_CallObject(type, NULL); + PyErr_SetObject(type, val); + Py_DECREF(val); } else { val = type; assert (PyExceptionInstance_Check(val)); type = (PyObject*)Py_TYPE(val); assert (PyExceptionClass_Check(type)); + PyErr_SetObject(type, val); } - PyErr_SetObject(type, val); } return FutureIter_iternext(self); } |