[pypy-commit] pypy default: Raise ProcessorAutodetectError for unknown machine names

stefanor noreply at buildbot.pypy.org
Mon May 26 01:08:18 CEST 2014


Author: Stefano Rivera <stefano at rivera.za.net>
Branch: 
Changeset: r71731:eacab5168076
Date: 2014-05-26 01:07 +0200
http://bitbucket.org/pypy/pypy/changeset/eacab5168076/

Log:	Raise ProcessorAutodetectError for unknown machine names

	Previously this function was only used for the JIT, so it only had
	to support machines that the JIT supports. Now, it's used by
	rpython.rlib.rawstorage, and should raise an appropriate exception,
	rather than KeyError, on unknown machines.

diff --git a/rpython/jit/backend/detect_cpu.py b/rpython/jit/backend/detect_cpu.py
--- a/rpython/jit/backend/detect_cpu.py
+++ b/rpython/jit/backend/detect_cpu.py
@@ -63,7 +63,10 @@
             'AMD64': MODEL_X86,    # win64
             'armv7l': MODEL_ARM,
             'armv6l': MODEL_ARM,
-            }[mach]
+            }.get(mach)
+
+    if result is None:
+        raise ProcessorAutodetectError, "unknown machine name %s" % mach
     #
     if result.startswith('x86'):
         if sys.maxint == 2**63-1:


More information about the pypy-commit mailing list