Skip to content

Commit 3a67467

Browse files
committed
Resolve symlinks before file check (needed for Windows)
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent c55803d commit 3a67467

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/getpath.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,12 @@ def search_up(prefix, *landmarks, test=isfile):
774774
# ******************************************************************************
775775

776776
# Warn if the standard library is missing
777-
if not stdlib_zip or not isfile(stdlib_zip):
777+
if not stdlib_zip or not isfile(realpath(stdlib_zip)):
778778
home_hint = f"The Python 'home' directory was set to {home!r}, is this correct?"
779-
if not stdlib_dir or not isdir(stdlib_dir):
779+
if not stdlib_dir or not isdir(realpath(stdlib_dir)):
780780
hint = home_hint if home else f'sys.prefix is set to {prefix}, is this correct?'
781781
warn('WARN: Could not find the standard library directory! ' + hint)
782-
elif (not platstdlib_dir and not build_prefix) or not isdir(platstdlib_dir):
782+
elif (not platstdlib_dir and not build_prefix) or not isdir(realpath(platstdlib_dir)):
783783
hint = home_hint if home else f'sys.exec_prefix is set to {exec_prefix}, is this correct?'
784784
warn('WARN: Could not find the platform standard library directory! ' + hint)
785785

0 commit comments

Comments
 (0)