8000 bpo-45582: Fix test_embed failure during a PGO build on Windows by neonene · Pull Request #30014 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-45582: Fix test_embed failure during a PGO build on Windows #30014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 10, 2021
Prev Previous commit
Next Next commit
Use different VPATH in test_init_pybuilddir_win32
  • Loading branch information
neonene authored Dec 9, 2021
commit 0529d08d7a72a776543f68f3ea34368b0f838333
12 changes: 9 additions & 3 deletions Lib/test/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,11 +1292,17 @@ def test_init_pybuilddir(self):
def test_init_pybuilddir_win32(self):
# Test path configuration with pybuilddir.txt configuration file

with self.tmpdir_with_python(r'PCbuild\arch') as tmpdir:
if os.path.basename(os.path.dirname(sys.executable)) == 'instrumented':
subdir = r'PCbuild\arch\instrumented'
vpath = r'..\..\..'
else:
subdir = r'PCbuild\arch'
vpath = r'..\..'
with self.tmpdir_with_python(subdir) as tmpdir:
# The prefix is dirname(executable) + VPATH
prefix = os.path.normpath(os.path.join(tmpdir, r'..\..'))
prefix = os.path.normpath(os.path.join(tmpdir, vpath))
# The stdlib dir is dirname(executable) + VPATH + 'Lib'
stdlibdir = os.path.normpath(os.path.join(tmpdir, r'..\..\Lib'))
stdlibdir = os.path.normpath(os.path.join(tmpdir, vpath, 'Lib'))

filename = os.path.join(tmpdir, 'pybuilddir.txt')
with open(filename, "w", encoding="utf8") as fp:
Expand Down
0