[Python-checkins] cpython: Issue #17176: Document that imp.NullImporter is no longer inserted

brett.cannon python-checkins at python.org
Wed Mar 13 19:03:08 CET 2013


http://hg.python.org/cpython/rev/8e390e4784b0
changeset: 82645:8e390e4784b0
user: Brett Cannon <brett at python.org>
date: Wed Mar 13 10:46:22 2013 -0700
summary:
 Issue #17176: Document that imp.NullImporter is no longer inserted
into sys.path_importer_cache.
files:
 Doc/library/imp.rst | 9 +++++----
 Doc/library/sys.rst | 9 ++++++---
 2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst
--- a/Doc/library/imp.rst
+++ b/Doc/library/imp.rst
@@ -326,16 +326,17 @@
 with an existing directory or empty string raises :exc:`ImportError`.
 Otherwise, a :class:`NullImporter` instance is returned.
 
- Python adds instances of this type to ``sys.path_importer_cache`` for any path
- entries that are not directories and are not handled by any other path hooks on
- ``sys.path_hooks``. Instances have only one method:
-
+ Instances have only one method:
 
 .. method:: NullImporter.find_module(fullname [, path])
 
 This method always returns ``None``, indicating that the requested module could
 not be found.
 
+ .. versionchanged:: 3.3
+ ``None`` is inserted into ``sys.path_importer_cache`` instead of an
+ instance of :class:`NullImporter`.
+
 
 .. _examples-imp:
 
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -785,12 +785,15 @@
 A dictionary acting as a cache for :term:`finder` objects. The keys are
 paths that have been passed to :data:`sys.path_hooks` and the values are
 the finders that are found. If a path is a valid file system path but no
- explicit finder is found on :data:`sys.path_hooks` then ``None`` is
- stored to represent the implicit default finder should be used. If the path
- is not an existing path then :class:`imp.NullImporter` is set.
+ finder is found on :data:`sys.path_hooks` then ``None`` is
+ stored.
 
 Originally specified in :pep:`302`.
 
+ .. versionchanged:: 3.3
+ ``None`` is stored instead of :class:`imp.NullImporter` when no finder
+ is found.
+
 
 .. data:: platform
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /