[pypy-svn] r78959 - pypy/trunk/pypy/jit/metainterp/optimizeopt

antocuni at codespeak.net antocuni at codespeak.net
Wed Nov 10 13:27:13 CET 2010


Author: antocuni
Date: Wed Nov 10 13:27:11 2010
New Revision: 78959

Modified:
   pypy/trunk/pypy/jit/metainterp/optimizeopt/optimizer.py
Log:
don't rely on catching NotImplementedError, it's not rpython


Modified: pypy/trunk/pypy/jit/metainterp/optimizeopt/optimizer.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/optimizeopt/optimizer.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/optimizeopt/optimizer.py	Wed Nov 10 13:27:11 2010
@@ -66,10 +66,10 @@
         assert isinstance(constbox, Const)
         self.box = constbox
         self.level = LEVEL_CONSTANT
-        try:
-            val = self.box.getint()
+        if isinstance(constbox, ConstInt):
+            val = constbox.getint()
             self.intbound = IntBound(val, val)
-        except NotImplementedError:
+        else:
             self.intbound = IntUnbounded()
 
     def get_constant_class(self, cpu):



More information about the Pypy-commit mailing list