diff options
author | Barry Warsaw <barry@python.org> | 2012-11-20 20:22:51 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2012-11-20 20:22:51 (GMT) |
commit | 82c1c781c7ee6496bd4c404b7ba972eed5dbcb12 (patch) | |
tree | e487dc3ab171e765a0a272921fa0db38df43a596 /Lib/importlib | |
parent | 23089ab1db23333457149b567c125c10445550b6 (diff) | |
download | cpython-82c1c781c7ee6496bd4c404b7ba972eed5dbcb12.zip cpython-82c1c781c7ee6496bd4c404b7ba972eed5dbcb12.tar.gz cpython-82c1c781c7ee6496bd4c404b7ba972eed5dbcb12.tar.bz2 |
- Issue #16514: Fix regression causing a traceback when sys.path[0] is None
(actually, any non-string or non-bytes type).
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 2 |
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'): |