mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #17176: Document that imp.NullImporter is no longer inserted
into sys.path_importer_cache.
This commit is contained in:
parent
8c457d26b1
commit
2514b4871f
2 changed files with 11 additions and 7 deletions
|
@ -326,16 +326,17 @@ to indicate the search result of :func:`find_module`.
|
|||
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:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue