mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #26081: Fix refleak in _asyncio.Future.__iter__().throw.
This commit is contained in:
parent
c3d7dbb821
commit
692796a948
2 changed files with 5 additions and 1 deletions
|
@ -38,6 +38,8 @@ Library
|
||||||
|
|
||||||
- Issue #28634: Fix asyncio.isfuture() to support unittest.Mock.
|
- Issue #28634: Fix asyncio.isfuture() to support unittest.Mock.
|
||||||
|
|
||||||
|
- Issue #26081: Fix refleak in _asyncio.Future.__iter__().throw.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|
|
@ -1044,14 +1044,16 @@ FutureIter_throw(futureiterobject *self, PyObject *args)
|
||||||
else {
|
else {
|
||||||
if (PyExceptionClass_Check(type)) {
|
if (PyExceptionClass_Check(type)) {
|
||||||
val = PyObject_CallObject(type, NULL);
|
val = PyObject_CallObject(type, NULL);
|
||||||
|
PyErr_SetObject(type, val);
|
||||||
|
Py_DECREF(val);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val = type;
|
val = type;
|
||||||
assert (PyExceptionInstance_Check(val));
|
assert (PyExceptionInstance_Check(val));
|
||||||
type = (PyObject*)Py_TYPE(val);
|
type = (PyObject*)Py_TYPE(val);
|
||||||
assert (PyExceptionClass_Check(type));
|
assert (PyExceptionClass_Check(type));
|
||||||
|
PyErr_SetObject(type, val);
|
||||||
}
|
}
|
||||||
PyErr_SetObject(type, val);
|
|
||||||
}
|
}
|
||||||
return FutureIter_iternext(self);
|
return FutureIter_iternext(self);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue