summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTrent Nelson <trent.nelson@snakebite.org>2008-03-19 06:28:24 (GMT)
committerTrent Nelson <trent.nelson@snakebite.org>2008-03-19 06:28:24 (GMT)
commitb27745fb6d522b18cef532e4b51c9368d568e90e (patch)
tree08832aeff728912850bbc49bdf5f2c8fedba8375 /Lib
parent16b2e6bd7f1acc0ef7b5610acab71d639e5f193f (diff)
downloadcpython-b27745fb6d522b18cef532e4b51c9368d568e90e.zip
cpython-b27745fb6d522b18cef532e4b51c9368d568e90e.tar.gz
cpython-b27745fb6d522b18cef532e4b51c9368d568e90e.tar.bz2
Issue2290: Support x64 Windows builds that live in pcbuild/amd64. Without it, sysutils._python_build() returns the wrong directory, which causes the test_get_config_h_filename method in Lib/distutils/tests/test_sysconfig.py to fail.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/sysconfig.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 506cf38..27a770b 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -23,7 +23,8 @@ PREFIX = os.path.normpath(sys.prefix)
EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
# Path to the base directory of the project. On Windows the binary may
-# live in project/PCBuild9
+# live in project/PCBuild9. If we're dealing with an x64 Windows build,
+# it'll live in project/PCbuild/amd64.
project_base = os.path.dirname(os.path.abspath(sys.executable))
if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
@@ -31,6 +32,10 @@ if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
if os.name == "nt" and "\\pc\\v" in project_base[-10:].lower():
project_base = os.path.abspath(os.path.join(project_base, os.path.pardir,
os.path.pardir))
+# PC/AMD64
+if os.name == "nt" and "\\pcbuild\\amd64" in project_base[-14:].lower():
+ project_base = os.path.abspath(os.path.join(project_base, os.path.pardir,
+ os.path.pardir))
# python_build: (Boolean) if true, we're either building Python or
# building an extension with an un-installed Python, so we use