diff options
Diffstat (limited to 'third_party/python/pip')
-rw-r--r-- | third_party/python/pip/pip/_vendor/pkg_resources/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/python/pip/pip/_vendor/pkg_resources/__init__.py b/third_party/python/pip/pip/_vendor/pkg_resources/__init__.py index 4cd562cf94..9f5b9e7074 100644 --- a/third_party/python/pip/pip/_vendor/pkg_resources/__init__.py +++ b/third_party/python/pip/pip/_vendor/pkg_resources/__init__.py @@ -2161,7 +2161,8 @@ def resolve_egg_link(path): return next(dist_groups, ()) -register_finder(pkgutil.ImpImporter, find_on_path) +if hasattr(pkgutil, 'ImpImporter'): + register_finder(pkgutil.ImpImporter, find_on_path) if hasattr(importlib_machinery, 'FileFinder'): register_finder(importlib_machinery.FileFinder, find_on_path) @@ -2312,7 +2313,8 @@ def file_ns_handler(importer, path_item, packageName, module): return subpath -register_namespace_handler(pkgutil.ImpImporter, file_ns_handler) +if hasattr(pkgutil, 'ImpImporter'): + register_namespace_handler(pkgutil.ImpImporter, file_ns_handler) register_namespace_handler(zipimport.zipimporter, file_ns_handler) if hasattr(importlib_machinery, 'FileFinder'): |