[pypy-commit] pypy default: fix is_valid_int for r_int and friends for untranslated testing

mattip noreply at buildbot.pypy.org
Sun Feb 24 16:27:56 CET 2013


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r61730:f4e2d6247ba9
Date: 2013-02-24 17:27 +0200
http://bitbucket.org/pypy/pypy/changeset/f4e2d6247ba9/

Log:	fix is_valid_int for r_int and friends for untranslated testing

diff --git a/rpython/rlib/rarithmetic.py b/rpython/rlib/rarithmetic.py
--- a/rpython/rlib/rarithmetic.py
+++ b/rpython/rlib/rarithmetic.py
@@ -157,7 +157,7 @@
 def is_valid_int(r):
     if objectmodel.we_are_translated():
         return isinstance(r, int)
-    return type(r) in (int, long, bool) and (
+    return isinstance(r, (base_int, int, long, bool)) and (
         -maxint - 1 <= r <= maxint)
 is_valid_int._annspecialcase_ = 'specialize:argtype(0)'
 


More information about the pypy-commit mailing list