summaryrefslogtreecommitdiffstats
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-04-03 11:10:54 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-04-03 11:10:54 (GMT)
commit13019fdef3b6d589f8d7602943c76fcc637114ea (patch)
tree975aa7bea2e9e07236ef08b4e485e46079ff5b9f /Python/pylifecycle.c
parent21dfffa218be821af03bc3cdf928a62e9431aaf8 (diff)
downloadcpython-13019fdef3b6d589f8d7602943c76fcc637114ea.zip
cpython-13019fdef3b6d589f8d7602943c76fcc637114ea.tar.gz
cpython-13019fdef3b6d589f8d7602943c76fcc637114ea.tar.bz2
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).
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 38543e0..bab3a2f 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -405,15 +405,15 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
if (!install_importlib)
return;
+ if (_PyTime_Init() < 0)
+ Py_FatalError("Py_Initialize: can't initialize time");
+
import_init(interp, sysmod);
/* initialize the faulthandler module */
if (_PyFaulthandler_Init())
Py_FatalError("Py_Initialize: can't initialize faulthandler");
- if (_PyTime_Init() < 0)
- Py_FatalError("Py_Initialize: can't initialize time");
-
if (initfsencoding(interp) < 0)
Py_FatalError("Py_Initialize: unable to load the file system codec");