mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-03-03 23:55:46 +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);
|
Py_DECREF(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
PyErr_SetString(InterfaceError, "failed localtime call");
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,6 +455,10 @@ psyco_TimeFromTicks(PyObject *self, PyObject *args)
|
||||||
Py_DECREF(args);
|
Py_DECREF(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
PyErr_SetString(InterfaceError, "failed localtime call");
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -473,6 +481,9 @@ psyco_TimestampFromTicks(PyObject *self, PyObject *args)
|
||||||
tm.tm_hour, tm.tm_min, (double)tm.tm_sec + ticks,
|
tm.tm_hour, tm.tm_min, (double)tm.tm_sec + ticks,
|
||||||
pyPsycopgTzLOCAL);
|
pyPsycopgTzLOCAL);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
PyErr_SetString(InterfaceError, "failed localtime call");
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user