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:
@@ -174,13 +174,13 @@ Py_Initialize(void)
|
||||
|
||||
_PyImportHooks_Init();
|
||||
|
||||
PyModule_WarningsModule = PyImport_ImportModule("warnings");
|
||||
|
||||
initsigs(); /* Signal handling stuff, including initintr() */
|
||||
|
||||
initmain(); /* Module __main__ */
|
||||
if (!Py_NoSiteFlag)
|
||||
initsite(); /* Module site */
|
||||
|
||||
PyModule_WarningsModule = PyImport_ImportModule("warnings");
|
||||
}
|
||||
|
||||
#ifdef COUNT_ALLOCS
|
||||
|
||||
Reference in New Issue
Block a user