Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e20349

Browse files
committed
Fixed _sys_home computation and added diagnostics for Windows buildbot failures.
1 parent 0b43bcf commit 7e20349

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lib/distutils/sysconfig.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def _is_python_source_dir(d):
5050
if _sys_home and os.name == 'nt' and \
5151
_sys_home.lower().endswith(('pcbuild', 'pcbuild\\amd64')):
5252
_sys_home = os.path.dirname(_sys_home)
53+
if _sys_home.endswith('pcbuild'): # must be amd64
54+
_sys_home = os.path.dirname(_sys_home)
5355
def _python_build():
5456
if _sys_home:
5557
return _is_python_source_dir(_sys_home)

Lib/sysconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def _is_python_source_dir(d):
107107
if _sys_home and os.name == 'nt' and \
108108
_sys_home.lower().endswith(('pcbuild', 'pcbuild\\amd64')):
109109
_sys_home = os.path.dirname(_sys_home)
110-
110+
if _sys_home.endswith('pcbuild'): # must be amd64
111+
_sys_home = os.path.dirname(_sys_home)
111112
def is_python_build(check_home=False):
112113
if check_home and _sys_home:
113114
return _is_python_source_dir(_sys_home)

Lib/test/test_venv.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ def isdir(*args):
7676
data = self.get_text_file_contents(self.bindir, self.ps3name)
7777
self.assertTrue(data.startswith('#!%s%s' % (self.env_dir, os.sep)))
7878
fn = self.get_env_file(self.bindir, self.exe)
79-
self.assertTrue(os.path.exists(fn), 'File %r exists' % fn)
79+
if not os.path.exists(fn): # diagnostics for Windows buildbot failures
80+
print('Contents of %r:' % self.bindir)
81+
print(' %r' % os.listdir(self.bindir))
82+
self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn)
8083

8184
def test_overwrite_existing(self):
8285
"""

0 commit comments

Comments
 (0)