diff options
| author | Steven Knight <knight@baldmt.com> | 2009-11-28 06:17:41 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2009-11-28 06:17:41 (GMT) |
| commit | 6635484c1391d76648d4602b589eb0c348bfcd74 (patch) | |
| tree | 9a1a8ea19dabb1acdd61ac26e3e1845e5b105614 /src/engine | |
| parent | 6857194764c8c5428a3973d8bf657d3735f48376 (diff) | |
| download | SCons-6635484c1391d76648d4602b589eb0c348bfcd74.zip SCons-6635484c1391d76648d4602b589eb0c348bfcd74.tar.gz SCons-6635484c1391d76648d4602b589eb0c348bfcd74.tar.bz2 | |
Fix get_host_target()'s use of platform.machine() on Python versions
before 2.6, when it always returns a null string.
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 7ccb207..ac6e9b3 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -88,6 +88,11 @@ def get_host_target(env): host_platform = env.get('HOST_ARCH') if not host_platform: host_platform = platform.machine() + # TODO(2.5): the native Python platform.machine() function returns + # '' on all Python versions before 2.6, after which it also uses + # PROCESSOR_ARCHITECTURE. + if not host_platform: + host_platform = os.environ.get('PROCESSOR_ARCHITECTURE', '') target_platform = env.get('TARGET_ARCH') if not target_platform: target_platform = host_platform @@ -95,7 +100,8 @@ def get_host_target(env): try: host = _ARCH_TO_CANONICAL[host_platform] except KeyError, e: - raise ValueError("Unrecognized host architecture %s" % host_platform) + msg = "Unrecognized host architecture %s" + raise ValueError(msg % repr(host_platform)) try: target = _ARCH_TO_CANONICAL[target_platform] |
