[pypy-svn] r73434 - pypy/branch/cpython-extension/pypy/module/cpyext

xoraxax at codespeak.net xoraxax at codespeak.net
Tue Apr 6 03:13:14 CEST 2010


Author: xoraxax
Date: Tue Apr  6 03:13:12 2010
New Revision: 73434

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/api.py
Log:
Also allow llvalues as return values in the wrapper.

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/api.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/api.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/api.py	Tue Apr  6 03:13:12 2010
@@ -360,7 +360,8 @@
 
         if callable.api_func.restype is PyObject:
             borrowed = callable.api_func.borrowed
-            retval = make_ref(space, retval, borrowed=borrowed)
+            if not rffi._isllptr(retval):
+                retval = make_ref(space, retval, borrowed=borrowed)
             if borrowed:
                 try:
                     add_borrowed_object(space, retval)



More information about the Pypy-commit mailing list