Author: Benjamin Peterson <benja...@python.org> Branch: py3k Changeset: r53667:4468c743a23c Date: 2012-03-14 22:46 -0500 http://bitbucket.org/pypy/pypy/changeset/4468c743a23c/
Log: merge default diff --git a/pypy/jit/tl/tlc.py b/pypy/jit/tl/tlc.py --- a/pypy/jit/tl/tlc.py +++ b/pypy/jit/tl/tlc.py @@ -6,6 +6,8 @@ from pypy.jit.tl.tlopcode import * from pypy.jit.tl import tlopcode from pypy.rlib.jit import JitDriver, elidable +from pypy.rlib.rarithmetic import is_valid_int + class Obj(object): @@ -219,7 +221,7 @@ class Frame(object): def __init__(self, args, pc): - assert isinstance(pc, int) + assert is_valid_int(pc) self.args = args self.pc = pc self.stack = [] @@ -239,7 +241,7 @@ return interp_eval(code, pc, args, pool).int_o() def interp_eval(code, pc, args, pool): - assert isinstance(pc, int) + assert is_valid_int(pc) frame = Frame(args, pc) pc = frame.pc diff --git a/pypy/objspace/std/test/test_intobject.py b/pypy/objspace/std/test/test_intobject.py --- a/pypy/objspace/std/test/test_intobject.py +++ b/pypy/objspace/std/test/test_intobject.py @@ -2,7 +2,7 @@ import sys from pypy.objspace.std import intobject as iobj from pypy.objspace.std.multimethod import FailedToImplement -from pypy.rlib.rarithmetic import r_uint +from pypy.rlib.rarithmetic import r_uint, is_valid_int from pypy.rlib.rbigint import rbigint @@ -15,7 +15,7 @@ while 1: ires = x << n lres = l << n - if type(ires) is long or lres != ires: + if not is_valid_int(ires) or lres != ires: return n n += 1 diff --git a/pypy/objspace/std/test/test_listobject.py b/pypy/objspace/std/test/test_listobject.py --- a/pypy/objspace/std/test/test_listobject.py +++ b/pypy/objspace/std/test/test_listobject.py @@ -3,6 +3,7 @@ from pypy.objspace.std.listobject import W_ListObject, SizeListStrategy,\ IntegerListStrategy, ObjectListStrategy from pypy.interpreter.error import OperationError +from pypy.rlib.rarithmetic import is_valid_int from pypy.conftest import gettestobjspace, option @@ -242,7 +243,7 @@ self.space.raises_w(self.space.w_IndexError, self.space.setitem, w_list, w(key), w(42)) else: - if isinstance(value, int): # non-slicing + if is_valid_int(value): # non-slicing if random.random() < 0.25: # deleting self.space.delitem(w_list, w(key)) del expected[key] _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit