mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
- Issue #16514: Fix regression causing a traceback when sys.path[0] is None
(actually, any non-string or non-bytes type).
This commit is contained in:
parent
23089ab1db
commit
82c1c781c7
6 changed files with 111 additions and 77 deletions
|
@ -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'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue