diff options
author | Shantanu <12621235+hauntsaninja@users.noreply.github.com> | 2023-01-25 20:01:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-25 20:01:01 (GMT) |
commit | a178ba82bfe2f2fb6f6ff0e67cb734fd7c4321e3 (patch) | |
tree | e87728fb6aa1ee3717d8483e2b14638b7e89ffbf /Modules/_asynciomodule.c | |
parent | 952a1d9cc970508b280af475c0be1809692f0c76 (diff) | |
download | cpython-a178ba82bfe2f2fb6f6ff0e67cb734fd7c4321e3.zip cpython-a178ba82bfe2f2fb6f6ff0e67cb734fd7c4321e3.tar.gz cpython-a178ba82bfe2f2fb6f6ff0e67cb734fd7c4321e3.tar.bz2 |
gh-101326: Fix regression when passing None to FutureIter.throw (#101327)
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r-- | Modules/_asynciomodule.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 6fe4ca4..055dded 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -1694,7 +1694,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; } |