summaryrefslogtreecommitdiff
path: root/Lib/pkgutil.py
diff options
context:
space:
mode:
authorPhillip J. Eby <pje@telecommunity.com>2006-07-28 21:12:07 +0000
committerPhillip J. Eby <pje@telecommunity.com>2006-07-28 21:12:07 +0000
commit44d77fc2fcfcbcb3fb6f2c325dc8f4ef5434c123 (patch)
tree0402636ef5ecc29c641474142ba4ad8dd0d0445e /Lib/pkgutil.py
parentdcb27a0504513feb3510830ddcdc996f817663d9 (diff)
downloadcpython-44d77fc2fcfcbcb3fb6f2c325dc8f4ef5434c123.tar.gz
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/pkgutil.py')
-rw-r--r--Lib/pkgutil.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index f4347e5e54..37738e4a75 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: