summaryrefslogtreecommitdiffstats
path: root/Modules/_asynciomodule.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2021-12-17 14:46:22 (GMT)
committerGitHub <noreply@github.com>2021-12-17 14:46:22 (GMT)
commit396b58345f81d4c8c5a52546d2288e666a1b9b8b (patch)
tree89140d0930da874df676cfac27d2e85e746a5fc1 /Modules/_asynciomodule.c
parent62a0a2a25dbe3ba6f2973a37a3022d982fdc163c (diff)
downloadcpython-396b58345f81d4c8c5a52546d2288e666a1b9b8b.zip
cpython-396b58345f81d4c8c5a52546d2288e666a1b9b8b.tar.gz
cpython-396b58345f81d4c8c5a52546d2288e666a1b9b8b.tar.bz2
bpo-45711: Remove type and traceback from exc_info (GH-30122)
* Do not PUSH/POP traceback or type to the stack as part of exc_info * Remove exc_traceback and exc_type from _PyErr_StackItem * Add to what's new, because this change breaks things like Cython
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r--Modules/_asynciomodule.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index 267faac..978a1fd 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -810,9 +810,7 @@ FutureObj_traverse(FutureObj *fut, visitproc visit, void *arg)
Py_VISIT(fut->dict);
_PyErr_StackItem *exc_state = &fut->fut_cancelled_exc_state;
- Py_VISIT(exc_state->exc_type);
Py_VISIT(exc_state->exc_value);
- Py_VISIT(exc_state->exc_traceback);
return 0;
}
@@ -1376,10 +1374,6 @@ _asyncio_Future__make_cancelled_error_impl(FutureObj *self)
PyException_SetContext(exc, Py_NewRef(exc_state->exc_value));
_PyErr_ClearExcState(exc_state);
}
- else {
- assert(exc_state->exc_type == NULL);
- assert(exc_state->exc_traceback == NULL);
- }
return exc;
}
@@ -2706,13 +2700,13 @@ task_step_impl(TaskObj *task, PyObject *exc)
PyErr_NormalizeException(&et, &ev, &tb);
if (tb != NULL) {
PyException_SetTraceback(ev, tb);
+ Py_DECREF(tb);
}
+ Py_XDECREF(et);
FutureObj *fut = (FutureObj*)task;
_PyErr_StackItem *exc_state = &fut->fut_cancelled_exc_state;
- exc_state->exc_type = et;
exc_state->exc_value = ev;
- exc_state->exc_traceback = tb;
return future_cancel(fut, NULL);
}