@@ -68,18 +68,16 @@ def setUp(self):
6868 ext = ("_d" if debug_build (sys .executable ) else "" ) + ".exe"
6969 exename += ext
7070 exepath = builddir
71- expecteddir = os .path .join (support .REPO_ROOT , builddir )
7271 else :
7372 exepath = os .path .join (builddir , 'Programs' )
74- expecteddir = os .path .join (support .REPO_ROOT , 'Programs' )
7573 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 ):
7775 self .skipTest ("%r doesn't exist" % exe )
7876 # This is needed otherwise we get a fatal error:
7977 # "Py_Initialize: Unable to get the locale encoding
8078 # LookupError: no codec search functions registered: can't find encoding"
8179 self .oldcwd = os .getcwd ()
82- os .chdir (support . REPO_ROOT )
80+ os .chdir (builddir )
8381
8482 def tearDown (self ):
8583 os .chdir (self .oldcwd )
@@ -1316,10 +1314,11 @@ def test_init_pybuilddir(self):
13161314 with self .tmpdir_with_python () as tmpdir :
13171315 # pybuilddir.txt is a sub-directory relative to the current
13181316 # directory (tmpdir)
1317+ vpath = sysconfig .get_config_var ("VPATH" ) or ''
13191318 subdir = 'libdir'
13201319 libdir = os .path .join (tmpdir , subdir )
13211320 # 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' ) )
13231322 os .mkdir (libdir )
13241323
13251324 filename = os .path .join (tmpdir , 'pybuilddir.txt' )
0 commit comments