]> granicus.if.org Git - python/commitdiff
Fixed _sys_home computation and added diagnostics for Windows buildbot failures.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Sun, 27 May 2012 16:30:09 +0000 (17:30 +0100)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Sun, 27 May 2012 16:30:09 +0000 (17:30 +0100)
Lib/distutils/sysconfig.py
Lib/sysconfig.py
Lib/test/test_venv.py

index 59315f72799e5411eeaff193e732a60aaf60ff5f..e86cb23236ff13d2681eb6011a934bf7e6ff01f0 100644 (file)
@@ -50,6 +50,8 @@ _sys_home = getattr(sys, '_home', None)
 if _sys_home and os.name == 'nt' and \
     _sys_home.lower().endswith(('pcbuild', 'pcbuild\\amd64')):
     _sys_home = os.path.dirname(_sys_home)
+    if _sys_home.endswith('pcbuild'):   # must be amd64
+        _sys_home = os.path.dirname(_sys_home)
 def _python_build():
     if _sys_home:
         return _is_python_source_dir(_sys_home)
index 7350efbfa04aaed2bbac397f1206148e9e0d2996..ac1e75107c436665a17858112f37fef947a72d1a 100644 (file)
@@ -107,7 +107,8 @@ _sys_home = getattr(sys, '_home', None)
 if _sys_home and os.name == 'nt' and \
     _sys_home.lower().endswith(('pcbuild', 'pcbuild\\amd64')):
     _sys_home = os.path.dirname(_sys_home)
-
+    if _sys_home.endswith('pcbuild'):   # must be amd64
+        _sys_home = os.path.dirname(_sys_home)
 def is_python_build(check_home=False):
     if check_home and _sys_home:
         return _is_python_source_dir(_sys_home)
index 8e41a47fd0559f91ed19688a5e82060f153a68b5..2f2558f3f613e7c95be1e7730c89d9ee9733972e 100644 (file)
@@ -76,7 +76,10 @@ class BasicTest(BaseTest):
         data = self.get_text_file_contents(self.bindir, self.ps3name)
         self.assertTrue(data.startswith('#!%s%s' % (self.env_dir, os.sep)))
         fn = self.get_env_file(self.bindir, self.exe)
-        self.assertTrue(os.path.exists(fn), 'File %r exists' % fn)
+        if not os.path.exists(fn):  # diagnostics for Windows buildbot failures
+            print('Contents of %r:' % self.bindir)
+            print('    %r' % os.listdir(self.bindir))
+        self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn)
 
     def test_overwrite_existing(self):
         """