Skip to content

Commit f2e894c

Browse files
authored
bpo-30342: Fix sysconfig.is_python_build() on VS9.0 (#1544)
Fix sysconfig.is_python_build() if Python is built with Visual Studio 2008 (VS 9.0).
1 parent a5bb624 commit f2e894c

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎Lib/sysconfig.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ def _safe_realpath(path):
112112
# PC/VS7.1
113113
if os.name == "nt" and "\\pc\\v" in _PROJECT_BASE[-10:].lower():
114114
_PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir))
115+
# PC/VS9.0/amd64
116+
if (os.name == "nt"
117+
and os.path.basename(os.path.dirname(os.path.dirname(_PROJECT_BASE))).lower() == "pc"
118+
and os.path.basename(os.path.dirname(_PROJECT_BASE)).lower() == "vs9.0"):
119+
_PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir, pardir))
115120
# PC/AMD64
116121
if os.name == "nt" and "\\pcbuild\\amd64" in _PROJECT_BASE[-14:].lower():
117122
_PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir))

‎Lib/test/test_regrtest.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ def need_pcbuild(self):
267267
self.skipTest("Tools/buildbot/test.bat requires PCbuild build, "
268268
"found %s" % build_dir)
269269

270+
@unittest.skipUnless(sysconfig.is_python_build(),
271+
'test.bat script is not installed')
270272
@unittest.skipUnless(sys.platform == 'win32', 'Windows only')
271273
def test_tools_buildbot_test(self):
272274
self.need_pcbuild()

‎Misc/NEWS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Extension Modules
4242
Library
4343
-------
4444

45+
- bpo-30342: Fix sysconfig.is_python_build() if Python is built with Visual
46+
Studio 2008 (VS 9.0).
47+
4548
- bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma Lin.
4649

4750
- bpo-30243: Removed the __init__ methods of _json's scanner and encoder.

0 commit comments

Comments
 (0)