mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-03-03 07:45:45 +03:00
Raise an exception in case of failed localtime_r call
This commit is contained in:
parent
4d15b973b0
commit
d93732558d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user