]> granicus.if.org Git - python/commitdiff
Document the import semantics that if None is found in sys.modules for a module then...
authorBrett Cannon <bcannon@gmail.com>
Sun, 30 Aug 2009 04:00:12 +0000 (04:00 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 30 Aug 2009 04:00:12 +0000 (04:00 +0000)
Doc/reference/simple_stmts.rst
Misc/NEWS

index 2a34b69e350aeb0c5c8e52a817c70a2143e304a4..7387da72e91d738b4992bdb56b340011c5abea93 100644 (file)
@@ -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
 for the module or package can begin. The first place checked is
 :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::
     single: sys.meta_path
index ea061a7864993dc85cf62160cc574c70b163d4c1..5189aae4ecef5ad988323eb05c759bf152c1b22c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -174,6 +174,9 @@ Build
 Documenation
 ------------
 
+- Document that importing a module that has None in sys.modules triggers an
+  ImportError.
+
 - Issue #6556: Fixed the Distutils configuration files location explanation
   for Windows.