mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Document the import semantics that if None is found in sys.modules for a module then ImportError is raised.
This commit is contained in:
parent
4d75fc1ce9
commit
757df6e4cd
2 changed files with 6 additions and 1 deletions
|
@ -668,7 +668,9 @@ Once the name of the module is known (unless otherwise specified, the term
|
||||||
"module" will refer to both packages and modules), searching
|
"module" will refer to both packages and modules), searching
|
||||||
for the module or package can begin. The first place checked is
|
for the module or package can begin. The first place checked is
|
||||||
:data:`sys.modules`, the cache of all modules that have been imported
|
:data:`sys.modules`, the cache of all modules that have been imported
|
||||||
previously. If the module is found there then it is used in step (2) of import.
|
previously. If the module is found there then it is used in step (2) of import
|
||||||
|
unless :keyword:`None` is found in :data:`sys.modules`, in which case
|
||||||
|
:exc:`ImportError` is raised.
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
single: sys.meta_path
|
single: sys.meta_path
|
||||||
|
|
|
@ -174,6 +174,9 @@ Build
|
||||||
Documenation
|
Documenation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
- Document that importing a module that has None in sys.modules triggers an
|
||||||
|
ImportError.
|
||||||
|
|
||||||
- Issue #6556: Fixed the Distutils configuration files location explanation
|
- Issue #6556: Fixed the Distutils configuration files location explanation
|
||||||
for Windows.
|
for Windows.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue