mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Addendum to #683658:
import warnings.py _after_ site.py has run. This ensures that site.py is again the first .py to be imported, giving it back full control over sys.path.
This commit is contained in:
parent
7322b1ad46
commit
5bfba3aeb9
1 changed files with 2 additions and 2 deletions
|
@ -174,13 +174,13 @@ Py_Initialize(void)
|
||||||
|
|
||||||
_PyImportHooks_Init();
|
_PyImportHooks_Init();
|
||||||
|
|
||||||
PyModule_WarningsModule = PyImport_ImportModule("warnings");
|
|
||||||
|
|
||||||
initsigs(); /* Signal handling stuff, including initintr() */
|
initsigs(); /* Signal handling stuff, including initintr() */
|
||||||
|
|
||||||
initmain(); /* Module __main__ */
|
initmain(); /* Module __main__ */
|
||||||
if (!Py_NoSiteFlag)
|
if (!Py_NoSiteFlag)
|
||||||
initsite(); /* Module site */
|
initsite(); /* Module site */
|
||||||
|
|
||||||
|
PyModule_WarningsModule = PyImport_ImportModule("warnings");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef COUNT_ALLOCS
|
#ifdef COUNT_ALLOCS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue