summaryrefslogtreecommitdiffstats
path: root/Lib/pkgutil.py
diff options
context:
space:
mode:
authorMiguel Brito <5544985+miguendes@users.noreply.github.com>2021-05-11 23:27:22 (GMT)
committerGitHub <noreply@github.com>2021-05-11 23:27:22 (GMT)
commite9d7f88d5643f7e6387bf994c130503766d7eb92 (patch)
treee42e6c812aa4f7b16ecb79e6dbda897d1ed736e2 /Lib/pkgutil.py
parent8563a7052ccd98e6a381d361664ce567afd5eb6e (diff)
downloadcpython-e9d7f88d5643f7e6387bf994c130503766d7eb92.zip
cpython-e9d7f88d5643f7e6387bf994c130503766d7eb92.tar.gz
cpython-e9d7f88d5643f7e6387bf994c130503766d7eb92.tar.bz2
bpo-44061: Fix pkgutil.iter_modules regression when passed a pathlib.Path object (GH-25964)
Diffstat (limited to 'Lib/pkgutil.py')
-rw-r--r--Lib/pkgutil.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index 2c34298..48c1479 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -413,6 +413,7 @@ def get_importer(path_item):
The cache (or part of it) can be cleared manually if a
rescan of sys.path_hooks is necessary.
"""
+ path_item = os.fsdecode(path_item)
try:
importer = sys.path_importer_cache[path_item]
except KeyError: