From f3bcaf9f88aad2c423ebcd61121562f9834187d4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 8 Apr 2024 17:11:27 +0200 Subject: Merging upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- third_party/python/pip/pip/_vendor/pkg_resources/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'third_party/python/pip') 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'): -- cgit v1.2.3