Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/importlib/_bootstrap_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,8 @@ def _get_spec(cls, fullname, path, target=None):
# the list of paths that will become its __path__
namespace_path = []
for entry in path:
if hasattr(entry, '__fspath__'):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary as os.fspath() passes strings through without issue.

entry = _os.fspath(entry)
if not isinstance(entry, (str, bytes)):
continue
finder = cls._path_importer_cache(entry)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
adding compatibility for pathlike objects in sys.path
Copy link
Copy Markdown
Member

@brettcannon brettcannon Apr 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
adding compatibility for pathlike objects in sys.path
Add compatibility for path-like objects on sys.path.
Patch by jayyin.

Loading