Raise an exception in case of failed localtime_r call

This commit is contained in:
Daniele Varrazzo 2012-03-04 04:17:03 +00:00
parent 4d15b973b0
commit d93732558d

View File

@ -427,6 +427,10 @@ psyco_DateFromTicks(PyObject *self, PyObject *args)
Py_DECREF(args);
}
}
else {
PyErr_SetString(InterfaceError, "failed localtime call");
}
return res;
}
@ -451,6 +455,10 @@ psyco_TimeFromTicks(PyObject *self, PyObject *args)
Py_DECREF(args);
}
}
else {
PyErr_SetString(InterfaceError, "failed localtime call");
}
return res;
}
@ -473,6 +481,9 @@ psyco_TimestampFromTicks(PyObject *self, PyObject *args)
tm.tm_hour, tm.tm_min, (double)tm.tm_sec + ticks,
pyPsycopgTzLOCAL);
}
else {
PyErr_SetString(InterfaceError, "failed localtime call");
}
return res;
}