Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 78341:2f1494d243ad
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.
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Tue, 31 Jul 2012 02:55:49 +0200 |
| parents | 27e13497d545 |
| children | c55dbb84f3b4 |
comparison
equal
deleted
inserted
replaced
| 78340:d56b647f325a | 78341:2f1494d243ad |
|---|---|
| 354 | 354 |
| 355 _PyImport_Init(); | 355 _PyImport_Init(); |
| 356 | 356 |
| 357 _PyImportHooks_Init(); | 357 _PyImportHooks_Init(); |
| 358 | 358 |
| 359 /* Initialize _warnings. */ | |
| 360 _PyWarnings_Init(); | |
| 361 | |
| 362 if (!install_importlib) | |
| 363 return; | |
| 364 | |
| 365 import_init(interp, sysmod); | |
| 366 | |
| 359 /* initialize the faulthandler module */ | 367 /* initialize the faulthandler module */ |
| 360 if (_PyFaulthandler_Init()) | 368 if (_PyFaulthandler_Init()) |
| 361 Py_FatalError("Py_Initialize: can't initialize faulthandler"); | 369 Py_FatalError("Py_Initialize: can't initialize faulthandler"); |
| 362 | |
| 363 /* Initialize _warnings. */ | |
| 364 _PyWarnings_Init(); | |
| 365 | |
| 366 if (!install_importlib) | |
| 367 return; | |
| 368 | |
| 369 import_init(interp, sysmod); | |
| 370 | 370 |
| 371 _PyTime_Init(); | 371 _PyTime_Init(); |
| 372 | 372 |
| 373 if (initfsencoding(interp) < 0) | 373 if (initfsencoding(interp) < 0) |
| 374 Py_FatalError("Py_Initialize: unable to load the file system codec"); | 374 Py_FatalError("Py_Initialize: unable to load the file system codec"); |
