Author: Christian Tismer <[email protected]>
Branch: win64-stage1
Changeset: r53506:eef60611a3ef
Date: 2012-03-13 15:40 -0700
http://bitbucket.org/pypy/pypy/changeset/eef60611a3ef/
Log: merge
diff --git a/pypy/rpython/lltypesystem/llmemory.py
b/pypy/rpython/lltypesystem/llmemory.py
--- a/pypy/rpython/lltypesystem/llmemory.py
+++ b/pypy/rpython/lltypesystem/llmemory.py
@@ -60,7 +60,7 @@
return "<ItemOffset %r %r>" % (self.TYPE, self.repeat)
def __mul__(self, other):
- if not isinstance(other, (int, long)):
+ if not is_valid_int(other):
return NotImplemented
return ItemOffset(self.TYPE, self.repeat * other)
diff --git a/pypy/rpython/lltypesystem/test/test_llmemory.py
b/pypy/rpython/lltypesystem/test/test_llmemory.py
--- a/pypy/rpython/lltypesystem/test/test_llmemory.py
+++ b/pypy/rpython/lltypesystem/test/test_llmemory.py
@@ -1,6 +1,7 @@
from pypy.rpython.lltypesystem.llmemory import *
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.test.test_llinterp import interpret
+from pypy.rlib.rarithmetic import is_valid_int
import py
def test_simple():
@@ -639,12 +640,12 @@
assert cast_int_to_adr(0) == NULL
#
i = cast_adr_to_int(adr, mode="emulated")
- assert type(i) is int
+ assert is_valid_int(i)
i = cast_adr_to_int(NULL, mode="emulated")
- assert type(i) is int and i == 0
+ assert is_valid_int(i) and i == 0
#
i = cast_adr_to_int(adr, mode="forced")
- assert type(i) is int
+ assert is_valid_int(i)
#assert cast_int_to_adr(i) == adr -- depends on ll2ctypes details
i = cast_adr_to_int(NULL, mode="forced")
- assert type(i) is int and i == 0
+ assert is_valid_int(i) and i == 0
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit