summaryrefslogtreecommitdiffstats
path: root/Modules/_xxinterpchannelsmodule.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-02-24 21:43:03 (GMT)
committerGitHub <noreply@github.com>2023-02-24 21:43:03 (GMT)
commit2db23d10bf64bf7c061fd95c6a8079ddc5c9aa4b (patch)
treeaa29d63d7151d976ea301f5fadff1821333690c9 /Modules/_xxinterpchannelsmodule.c
parent568fc0dee42a353f327b059a48f97c911de904b3 (diff)
downloadcpython-2db23d10bf64bf7c061fd95c6a8079ddc5c9aa4b.zip
cpython-2db23d10bf64bf7c061fd95c6a8079ddc5c9aa4b.tar.gz
cpython-2db23d10bf64bf7c061fd95c6a8079ddc5c9aa4b.tar.bz2
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Modules/) (#102196)
Diffstat (limited to 'Modules/_xxinterpchannelsmodule.c')
-rw-r--r--Modules/_xxinterpchannelsmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_xxinterpchannelsmodule.c b/Modules/_xxinterpchannelsmodule.c
index 60538c3..a0cd4a2 100644
--- a/Modules/_xxinterpchannelsmodule.c
+++ b/Modules/_xxinterpchannelsmodule.c
@@ -100,9 +100,9 @@ add_new_type(PyObject *mod, PyType_Spec *spec, crossinterpdatafunc shared)
static int
_release_xid_data(_PyCrossInterpreterData *data, int ignoreexc)
{
- PyObject *exctype, *excval, *exctb;
+ PyObject *exc;
if (ignoreexc) {
- PyErr_Fetch(&exctype, &excval, &exctb);
+ exc = PyErr_GetRaisedException();
}
int res = _PyCrossInterpreterData_Release(data);
if (res < 0) {
@@ -125,7 +125,7 @@ _release_xid_data(_PyCrossInterpreterData *data, int ignoreexc)
}
}
if (ignoreexc) {
- PyErr_Restore(exctype, excval, exctb);
+ PyErr_SetRaisedException(exc);
}
return res;
}