diff options
author | Yury Selivanov <yury@magic.io> | 2016-12-01 16:37:47 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-12-01 16:37:47 (GMT) |
commit | edfe8869c8e888e676091c87330b3bf0f3d9814b (patch) | |
tree | 79374edcc19752888503e0c5f9f45b24e709aaf7 /Modules/_asynciomodule.c | |
parent | 4778eab1f2b70cd2431252cae987e4adb3729ce8 (diff) | |
download | cpython-edfe8869c8e888e676091c87330b3bf0f3d9814b.zip cpython-edfe8869c8e888e676091c87330b3bf0f3d9814b.tar.gz cpython-edfe8869c8e888e676091c87330b3bf0f3d9814b.tar.bz2 |
Merge 3.6 (issue #28843)
Diffstat (limited to 'Modules/_asynciomodule.c')
-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 19503a8..86f191d 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -1041,6 +1041,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, @@ -2001,6 +2003,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() */ |