summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 888c2f5..a18ccc4 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -1281,6 +1281,8 @@ class PathFinder:
# the list of paths that will become its __path__
namespace_path = []
for entry in path:
+ if not isinstance(entry, (str, bytes)):
+ continue
finder = cls._path_importer_cache(entry)
if finder is not None:
if hasattr(finder, 'find_loader'):