summaryrefslogtreecommitdiff
path: root/pkg_resources
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2021-01-06 17:40:30 +0100
committerPetr Viktorin <pviktori@redhat.com>2021-01-06 17:44:09 +0100
commitf146b387548711d8095002e3d1214ca98a8b0392 (patch)
tree743ce89db44368948ae7309f1ac5c058b30ca47f /pkg_resources
parent95a9c474d30acc729b536f9ad88ead7efab62c5d (diff)
downloadpython-setuptools-git-f146b387548711d8095002e3d1214ca98a8b0392.tar.gz
Avoid deprecated load_module() in pkg_resources namespace delaration
Fixes: https://github.com/pypa/setuptools/issues/2493
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 737f4d5f..99b7f680 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -38,6 +38,7 @@ import itertools
import inspect
import ntpath
import posixpath
+import importlib
from pkgutil import get_importer
try:
@@ -2209,7 +2210,7 @@ def _handle_ns(packageName, path_item):
if subpath is not None:
path = module.__path__
path.append(subpath)
- loader.load_module(packageName)
+ importlib.import_module(packageName)
_rebuild_mod_path(path, packageName, module)
return subpath