diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-02-24 21:43:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-24 21:43:03 (GMT) |
commit | 2db23d10bf64bf7c061fd95c6a8079ddc5c9aa4b (patch) | |
tree | aa29d63d7151d976ea301f5fadff1821333690c9 /Modules/_zoneinfo.c | |
parent | 568fc0dee42a353f327b059a48f97c911de904b3 (diff) | |
download | cpython-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/_zoneinfo.c')
-rw-r--r-- | Modules/_zoneinfo.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c index 6e1a376..c215a75 100644 --- a/Modules/_zoneinfo.c +++ b/Modules/_zoneinfo.c @@ -270,10 +270,9 @@ error: Py_CLEAR(self); cleanup: if (file_obj != NULL) { - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); + PyObject *exc = PyErr_GetRaisedException(); PyObject *tmp = PyObject_CallMethod(file_obj, "close", NULL); - _PyErr_ChainExceptions(exc, val, tb); + _PyErr_ChainExceptions1(exc); if (tmp == NULL) { Py_CLEAR(self); } |