Skip to content

Commit de3a21f

Browse files
committed
GH-145273: don't skip missing platstdlib_dir warning if stdlib_zip is found
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent 11840ca commit de3a21f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/getpath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,9 +776,9 @@ def search_up(prefix, *landmarks, test=isfile):
776776
# Warn if the standard library is missing, unless pythonpath_was_set was set, as
777777
# that skips parts of the stdlib directories calculation — assume the provided
778778
# pythonpath is correct. This is how subinterpreters initialize the path for eg.
779-
if not py_setpath and not pythonpath_was_set and (not stdlib_zip or not isfile(stdlib_zip)):
779+
if not py_setpath and not pythonpath_was_set:
780780
home_hint = f"The Python 'home' directory was set to {home!r}, is this correct?"
781-
if not stdlib_dir or not isdir(stdlib_dir):
781+
if (not stdlib_zip or not isfile(stdlib_zip)) and (not stdlib_dir or not isdir(stdlib_dir)):
782782
hint = home_hint if home else f'sys.prefix is set to {prefix}, is this correct?'
783783
warn('WARN: Could not find the standard library directory! ' + hint)
784784
elif not platstdlib_dir or not isdir(platstdlib_dir):

0 commit comments

Comments
 (0)