From de3a21f07fd8ef6006d8b50eaaaebd209dc74673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Thu, 5 Mar 2026 13:37:54 +0000 Subject: [PATCH] GH-145273: don't skip missing platstdlib_dir warning if stdlib_zip is found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- Modules/getpath.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/getpath.py b/Modules/getpath.py index 2f4d635a29585c..4dceb5cdc8dfcf 100644 --- a/Modules/getpath.py +++ b/Modules/getpath.py @@ -776,9 +776,9 @@ def search_up(prefix, *landmarks, test=isfile): # Warn if the standard library is missing, unless pythonpath_was_set was set, as # that skips parts of the stdlib directories calculation — assume the provided # pythonpath is correct. This is how subinterpreters initialize the path for eg. -if not py_setpath and not pythonpath_was_set and (not stdlib_zip or not isfile(stdlib_zip)): +if not py_setpath and not pythonpath_was_set: home_hint = f"The Python 'home' directory was set to {home!r}, is this correct?" - if not stdlib_dir or not isdir(stdlib_dir): + if (not stdlib_zip or not isfile(stdlib_zip)) and (not stdlib_dir or not isdir(stdlib_dir)): hint = home_hint if home else f'sys.prefix is set to {prefix}, is this correct?' warn('WARN: Could not find the standard library directory! ' + hint) elif not platstdlib_dir or not isdir(platstdlib_dir):