summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-07-31 00:55:49 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-07-31 00:55:49 (GMT)
commitd5698cbbcade36d49bb32e797499d1190c38558a (patch)
tree4c743f1ff57018f73dc118ebb08b97edbd83b260 /Python
parent60622ed12aed572573a95b88428f654e88b8e470 (diff)
downloadcpython-d5698cbbcade36d49bb32e797499d1190c38558a.zip
cpython-d5698cbbcade36d49bb32e797499d1190c38558a.tar.gz
cpython-d5698cbbcade36d49bb32e797499d1190c38558a.tar.bz2
Fix initialization of the faulthandler module
faulthandler requires the importlib if "-X faulthandler" option is present on the command line, so initialize faulthandler after importlib. Add also an unit test.
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 6ee9a5f..cafc09a 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -356,10 +356,6 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
_PyImportHooks_Init();
- /* initialize the faulthandler module */
- if (_PyFaulthandler_Init())
- Py_FatalError("Py_Initialize: can't initialize faulthandler");
-
/* Initialize _warnings. */
_PyWarnings_Init();
@@ -368,6 +364,10 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
import_init(interp, sysmod);
+ /* initialize the faulthandler module */
+ if (_PyFaulthandler_Init())
+ Py_FatalError("Py_Initialize: can't initialize faulthandler");
+
_PyTime_Init();
if (initfsencoding(interp) < 0)