diff options
author | Brett Cannon <brettcannon@users.noreply.github.com> | 2018-04-06 16:10:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-06 16:10:18 -0700 |
commit | 9e2be60634914f23db2ae5624e4acc9335bf5fea (patch) | |
tree | 9b1613b2c8bdad0fd942222c07a72e90e8dd509e /Doc | |
parent | bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) (diff) | |
download | cpython-9e2be60634914f23db2ae5624e4acc9335bf5fea.tar.gz cpython-9e2be60634914f23db2ae5624e4acc9335bf5fea.tar.bz2 cpython-9e2be60634914f23db2ae5624e4acc9335bf5fea.zip |
bpo-33169: Remove values of `None` from sys.path_importer_cache when invalidating caches (GH-6402)
An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/importlib.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index f9387c07e18..130aabf119a 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1081,7 +1081,12 @@ find and load modules. .. classmethod:: invalidate_caches() Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all - finders stored in :attr:`sys.path_importer_cache`. + finders stored in :data:`sys.path_importer_cache` that define the method. + Otherwise entries in :data:`sys.path_importer_cache` set to ``None`` are + deleted. + + .. versionchanged:: 3.7 + Entries of ``None`` in :data:`sys.path_importer_cache` are deleted. .. versionchanged:: 3.4 Calls objects in :data:`sys.path_hooks` with the current working |