bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build directories (GH-29979)

This commit is contained in:
Steve Dower 2021-12-08 02:18:21 +00:00 committed by GitHub
parent 32a67246b0
commit b0b3086279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -449,6 +449,10 @@ if not home_was_set and real_executable_dir and not py_setpath:
readlines(joinpath(real_executable_dir, BUILDDIR_TXT))[0],
)
build_prefix = joinpath(real_executable_dir, VPATH)
except IndexError:
# File exists but is empty
platstdlib_dir = real_executable_dir
build_prefix = joinpath(real_executable_dir, VPATH)
except FileNotFoundError:
if isfile(joinpath(real_executable_dir, BUILD_LANDMARK)):
build_prefix = joinpath(real_executable_dir, VPATH)