mirror of
https://github.com/python/cpython.git
synced 2025-11-09 01:51:26 +00:00
bpo-38735: Don't fail when importing from / with sys.pycache_prefix set (GH-30456)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
043f251154
commit
d8a9466e29
3 changed files with 16 additions and 1 deletions
|
|
@ -297,7 +297,8 @@ def cache_from_source(path, debug_override=None, *, optimization=None):
|
|||
# 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
|
||||
# happens to contain a colon at the second character.
|
||||
if head[1] == ':' and head[0] not in path_separators:
|
||||
# Slicing avoids issues with an empty (or short) `head`.
|
||||
if head[1:2] == ':' and head[0:1] not in path_separators:
|
||||
head = head[2:]
|
||||
|
||||
# Strip initial path separator from `head` to complete the conversion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue