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