@@ -67,18 +67,16 @@ def setUp(self):
67
67
ext = ("_d" if debug_build (sys .executable ) else "" ) + ".exe"
68
68
exename += ext
69
69
exepath = builddir
70
- expecteddir = os .path .join (support .REPO_ROOT , builddir )
71
70
else :
72
71
exepath = os .path .join (builddir , 'Programs' )
73
- expecteddir = os .path .join (support .REPO_ROOT , 'Programs' )
74
72
self .test_exe = exe = os .path .join (exepath , exename )
75
- if exepath != expecteddir or not os .path .exists (exe ):
73
+ if not os .path .exists (exe ):
76
74
self .skipTest ("%r doesn't exist" % exe )
77
75
# This is needed otherwise we get a fatal error:
78
76
# "Py_Initialize: Unable to get the locale encoding
79
77
# LookupError: no codec search functions registered: can't find encoding"
80
78
self .oldcwd = os .getcwd ()
81
- os .chdir (support . REPO_ROOT )
79
+ os .chdir (builddir )
82
80
83
81
def tearDown (self ):
84
82
os .chdir (self .oldcwd )
@@ -1375,10 +1373,11 @@ def test_init_pybuilddir(self):
1375
1373
with self .tmpdir_with_python () as tmpdir :
1376
1374
# pybuilddir.txt is a sub-directory relative to the current
1377
1375
# directory (tmpdir)
1376
+ vpath = sysconfig .get_config_var ("VPATH" ) or ''
1378
1377
subdir = 'libdir'
1379
1378
libdir = os .path .join (tmpdir , subdir )
1380
1379
# The stdlib dir is dirname(executable) + VPATH + 'Lib'
1381
- stdlibdir = os .path .join (tmpdir , 'Lib' )
1380
+ stdlibdir = os .path .normpath ( os . path . join (tmpdir , vpath , 'Lib' ) )
1382
1381
os .mkdir (libdir )
1383
1382
1384
1383
filename = os .path .join (tmpdir , 'pybuilddir.txt' )
0 commit comments