BUG: catch error while canonalizing arch for host/target.
authorcournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 05:04:17 +0000 (05:04 +0000)
committercournape <cournape@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 19 Nov 2009 05:04:17 +0000 (05:04 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4452 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/MSCommon/vc.py

index 623c511657fc23fb7857cb648a4e35c81409fddd..ee4ebe64d969127ec15aa7df5fe2ee05dfebbff9 100644 (file)
@@ -73,8 +73,17 @@ def get_host_target(env):
     if not target_platform:
         target_platform = host_platform
 
-    return (_ARCH_TO_CANONICAL[host_platform], 
-            _ARCH_TO_CANONICAL[target_platform])
+    try:
+        host = _ARCH_TO_CANONICAL[host_platform]
+    except KeyError, e:
+        raise ValueError("Unrecognized host architecture %s" % host_platform)
+
+    try:
+        target = _ARCH_TO_CANONICAL[target_platform]
+    except KeyError, e:
+        raise ValueError("Unrecognized target architecture %s" % target_platform)
+
+    return (host, target)
 
 _VCVER = ["10.0", "9.0", "8.0", "7.1", "7.0", "6.0"]