mirror of
https://github.com/python/cpython.git
synced 2025-07-10 04:45:36 +00:00
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.
This commit is contained in:
parent
60622ed12a
commit
d5698cbbca
2 changed files with 19 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue