diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_asynciomodule.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index b65fc02..4e8f74a 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -1042,6 +1042,8 @@ FutureIter_throw(futureiterobject *self, PyObject *args) if (PyExceptionClass_Check(type)) { PyErr_NormalizeException(&type, &val, &tb); + /* No need to call PyException_SetTraceback since we'll be calling + PyErr_Restore for `type`, `val`, and `tb`. */ } else if (PyExceptionInstance_Check(type)) { if (val) { PyErr_SetString(PyExc_TypeError, @@ -2003,6 +2005,9 @@ task_step_impl(TaskObj *task, PyObject *exc) if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject *) et)) { PyErr_NormalizeException(&et, &ev, &tb); } + if (tb != NULL) { + PyException_SetTraceback(ev, tb); + } o = future_set_exception((FutureObj*)task, ev); if (!o) { /* An exception in Task.set_exception() */ |