[pypy-svn] r59758 - pypy/branch/oo-jit/pypy/rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Fri Nov 7 12:15:23 CET 2008


Author: arigo
Date: Fri Nov  7 12:15:22 2008
New Revision: 59758

Modified:
   pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py
Log:
A quick hack for pyjitpl.


Modified: pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py
==============================================================================
--- pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py	(original)
+++ pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py	Fri Nov  7 12:15:22 2008
@@ -381,7 +381,7 @@
 # additionally, this adds mess to __del__ "semantics"
 _all_callbacks = []
 
-def lltype2ctypes(llobj, normalize=True):
+def lltype2ctypes(llobj, normalize=True, acceptgckind=False):
     """Convert the lltype object 'llobj' to its ctypes equivalent.
     'normalize' should only be False in tests, where we want to
     inspect the resulting ctypes object manually.
@@ -415,7 +415,8 @@
                 _all_callbacks.append(res)
                 return res
 
-        if T.TO._gckind != 'raw' and not T.TO._hints.get('callback', None):
+        if (T.TO._gckind != 'raw' and not T.TO._hints.get('callback', None)
+            and not acceptgckind):
             raise Exception("can only pass 'raw' data structures to C, not %r"
                             % (T.TO._gckind,))
         if container._storage is None:



More information about the Pypy-commit mailing list