[pypy-svn] pypy jitypes2: fix translation

antocuni commits-noreply at bitbucket.org
Thu Mar 24 14:55:22 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r42900:54d5bca7974e
Date: 2011-03-24 12:36 +0100
http://bitbucket.org/pypy/pypy/changeset/54d5bca7974e/

Log:	fix translation

diff --git a/pypy/module/_ffi/test/test__ffi.py b/pypy/module/_ffi/test/test__ffi.py
--- a/pypy/module/_ffi/test/test__ffi.py
+++ b/pypy/module/_ffi/test/test__ffi.py
@@ -193,6 +193,7 @@
         assert intptr.deref_pointer() is types.sint
         assert str(intptr) == '<ffi type (pointer to sint)>'
         assert types.sint.deref_pointer() is None
+        raises(TypeError, "types.Pointer(42)")
 
     def test_typed_pointer_args(self):
         """

diff --git a/pypy/module/_ffi/interp_ffi.py b/pypy/module/_ffi/interp_ffi.py
--- a/pypy/module/_ffi/interp_ffi.py
+++ b/pypy/module/_ffi/interp_ffi.py
@@ -121,6 +121,7 @@
 app_types.__dict__ = build_ffi_types()
 
 def descr_new_pointer(space, w_cls, w_pointer_to):
+    w_pointer_to = space.interp_w(W_FFIType, w_pointer_to)
     name = '(pointer to %s)' % w_pointer_to.name
     return W_FFIType(name, libffi.types.pointer, w_pointer_to = w_pointer_to)
 


More information about the Pypy-commit mailing list