Issue #22117: Add a new _PyTime_FromSeconds() function

Fix also _Py_InitializeEx_Private(): initialize time before initializing
import, import_init() uses the _PyTime API (for thread locks).
This commit is contained in:
Victor Stinner 2015-04-03 13:10:54 +02:00
parent 21dfffa218
commit 13019fdef3
6 changed files with 45 additions and 5 deletions

View file

@ -66,7 +66,10 @@ PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
_PyTime_round_t);
/* Create a timestamp from a number of nanoseconds (C long). */
/* Create a timestamp from a number of seconds. */
PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int ns);
/* Create a timestamp from a number of nanoseconds. */
PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(PY_LONG_LONG ns);
/* Convert a number of seconds (Python float or int) to a timetamp.