Issue #18408: Fix time.tzset(), detect exception when calling PyInit_timezone()

This commit is contained in:
Victor Stinner 2013-07-17 21:42:45 +02:00
parent 9a146eeadb
commit 2ff51b83b8
1 changed files with 2 additions and 0 deletions

View File

@ -851,6 +851,8 @@ time_tzset(PyObject *self, PyObject *unused)
/* Reset timezone, altzone, daylight and tzname */ /* Reset timezone, altzone, daylight and tzname */
PyInit_timezone(m); PyInit_timezone(m);
Py_DECREF(m); Py_DECREF(m);
if (PyErr_Occurred())
return NULL;
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;