summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorPhillip J. Eby <pje@telecommunity.com>2006-07-28 21:12:07 (GMT)
committerPhillip J. Eby <pje@telecommunity.com>2006-07-28 21:12:07 (GMT)
commitf7575d0cb7a10b252cc1e05a1d24facc2294a195 (patch)
tree28146830a0734bcbcb4e72ff634113f110e386bc /Lib
parent944f3b6ecba741b54fed1190980fba1272568ebe (diff)
downloadcpython-f7575d0cb7a10b252cc1e05a1d24facc2294a195.zip
cpython-f7575d0cb7a10b252cc1e05a1d24facc2294a195.tar.gz
cpython-f7575d0cb7a10b252cc1e05a1d24facc2294a195.tar.bz2
Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is used in ``sys.path_importer_cache`` to cache non-directory paths and avoid excessive filesystem operations during imports.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pkgutil.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index f4347e5..37738e4 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -381,9 +381,7 @@ def get_importer(path_item):
importer = None
sys.path_importer_cache.setdefault(path_item, importer)
- # The boolean values are used for caching valid and invalid
- # file paths for the built-in import machinery
- if importer in (None, True, False):
+ if importer is None:
try:
importer = ImpImporter(path_item)
except ImportError: