mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.11] gh-101326: Fix regression when passing None to FutureIter.throw (GH-101327) (#101328)
(cherry picked from commit a178ba82bf
)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
parent
5a8ed019f9
commit
cd0fe5ba09
3 changed files with 9 additions and 1 deletions
|
@ -1666,7 +1666,12 @@ FutureIter_throw(futureiterobject *self, PyObject *const *args, Py_ssize_t nargs
|
|||
val = args[1];
|
||||
}
|
||||
|
||||
if (tb != NULL && !PyTraceBack_Check(tb)) {
|
||||
if (val == Py_None) {
|
||||
val = NULL;
|
||||
}
|
||||
if (tb == Py_None ) {
|
||||
tb = NULL;
|
||||
} else if (tb != NULL && !PyTraceBack_Check(tb)) {
|
||||
PyErr_SetString(PyExc_TypeError, "throw() third argument must be a traceback");
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue