Message140769
Several import-related sys variables are set in _PyImportHooks_Init (in Python/import.c), which is called in Python/pythonrun.c. I have included a patch that moves that initialization from _PyImportHooks_Init to a new _SysImportState_Init function in Python/sysmodule.c, which is then called from _PyImportHooks_Init.
This may seem like an unnecessary change, but sysmodule.c is the obvious place to find the initialization of sys variables. Other than in pythonrun.c, import.c is the only place that sys variables are set outside of sysmodule.c.
Finally, several import related projects[1] are coming up that will impact import.c and _PyImportHooks_Init specifically. This change helps clean up import.c a little in preparation for those projects, and isolates out of import.c at least one thing that should be kept safe during any import.c refactoring.
[1] see issue #2377, PEP 402, and the GSOC import engine project. |
|
Date |
User |
Action |
Args |
2011-07-20 23:24:44 | eric.snow | set | recipients:
+ eric.snow |
2011-07-20 23:24:44 | eric.snow | set | messageid: <1311204284.83.0.766064550687.issue12598@psf.upfronthosting.co.za> |
2011-07-20 23:24:44 | eric.snow | link | issue12598 messages |
2011-07-20 23:24:44 | eric.snow | create | |
|