[Python-Dev] distutils.sys: None in sys.modules

M.-A. Lemburg mal@lemburg.com
Tue, 10 Apr 2001 13:43:32 +0200


Ka-Ping Yee wrote:
> 
> When i import distutils.util, i get:
> 
>     >>> sys.modules.keys()
>     ['os', 'distutils.sys', 'distutils.os', 'exceptions', 'posix', 'distutils.spawn', 're', 'sre_constants', 'distutils.errors', 'string', 'signal', 'sre', 'posixpath', 'sre_parse', '_sre', 'os.path', 'distutils.string', 'readline', 'distutils.util', 'distutils.re', '__main__', 'distutils.dep_util', 'types', 'sys', '__builtin__', 'site', 'UserDict', 'distutils', 'sre_compile', 'copy_reg', 'stat', 'distutils.distutils']
> 
> What are 'distutils.sys', 'distutils.os', 'distutils.string',
> 'distutils.re', 'distutils.distutils' doing in there? 

These are loaded by site.py for the case where you run Python
from the installation directory on Posix systems.

> (The
> sys.modules dictionary maps all these keys to None.)

This basically means that the corresponding modules have already
been loaded at top-level.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Pages:                           http://www.lemburg.com/python/