Merge 3.6 (issue #26081)

This commit is contained in:
Yury Selivanov 2016-11-08 19:05:42 -05:00
commit bff8f647a9
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}