diff options
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); } |