Addendum to #683658:
authorJust van Rossum <just@letterror.com>
Tue, 25 Feb 2003 20:25:12 +0000 (20:25 +0000)
committerJust van Rossum <just@letterror.com>
Tue, 25 Feb 2003 20:25:12 +0000 (20:25 +0000)
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.

Python/pythonrun.c

index 2845d2429512794e36d9acffa822184231682361..908bc42f6efc702ec1269aee02c82def9aada927 100644 (file)
@@ -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