bpo-45582: Don't fail if ENV_PATH is None in getpath.py (GH-31699) by tiran · Pull Request #31699 · python/cpython
if not executable and program_name: if not executable and program_name and ENV_PATH: # Resolve names against PATH. # NOTE: The use_environment value is ignored for this lookup. # To properly isolate, launch Python with a full path.