Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions Lib/importlib/_bootstrap_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ def cache_from_source(path, debug_override=None, *, optimization=None):
head = _path_abspath(head)

# Strip initial drive from a Windows path. We know we have an absolute
# path here, so the second part of the check rules out a POSIX path that
# path here, so the first part of the check rules out a POSIX path that
# happens to contain a colon at the second character.
if head[1] == ':' and head[0] not in path_separators:
if head[0] not in path_separators and head[1] == ':':
head = head[2:]

# Strip initial path separator from `head` to complete the conversion
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix failure when importing a module from the root directory on unix-like
platforms with sys.pycache_prefix set.