[pypy-commit] pypy jitypes2: now pointer types are cached, so we can simply check by identity

antocuni noreply at buildbot.pypy.org
Wed Jun 1 14:05:29 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r44621:4d19742e3132
Date: 2011-06-01 14:18 +0200
http://bitbucket.org/pypy/pypy/changeset/4d19742e3132/

Log:	now pointer types are cached, so we can simply check by identity

diff --git a/lib_pypy/_ctypes/pointer.py b/lib_pypy/_ctypes/pointer.py
--- a/lib_pypy/_ctypes/pointer.py
+++ b/lib_pypy/_ctypes/pointer.py
@@ -123,8 +123,7 @@
     my_ffitype = type(value).get_ffi_argtype()
     # for now, we always allow types.pointer, else a lot of tests
     # break. We need to rethink how pointers are represented, though
-    if my_ffitype.deref_pointer() != ffitype.deref_pointer() and \
-            ffitype is not _ffi.types.void_p:
+    if my_ffitype is not ffitype and ffitype is not _ffi.types.void_p:
         raise ArgumentError, "expected %s instance, got %s" % (type(value), ffitype)
     return value._get_buffer_value()
 


More information about the pypy-commit mailing list