diff options
author | Barry Warsaw <barry@python.org> | 2012-11-20 20:35:27 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2012-11-20 20:35:27 (GMT) |
commit | b72c10996e804413ebf0cb04ffc6e10f128b90c2 (patch) | |
tree | f81b41542a8c1c891d8973d0e65980f8afec5afb /Lib/importlib | |
parent | 47037d7e4e1f0f71a7640f1e71f8d558c3ac6668 (diff) | |
parent | 82c1c781c7ee6496bd4c404b7ba972eed5dbcb12 (diff) | |
download | cpython-b72c10996e804413ebf0cb04ffc6e10f128b90c2.zip cpython-b72c10996e804413ebf0cb04ffc6e10f128b90c2.tar.gz cpython-b72c10996e804413ebf0cb04ffc6e10f128b90c2.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 a924c79..2e0bd6a 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -1287,6 +1287,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'): |