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

xoraxax at codespeak.net xoraxax at codespeak.net
Sun Apr 11 23:19:05 CEST 2010


Author: xoraxax
Date: Sun Apr 11 23:19:03 2010
New Revision: 73658

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/api.py
   pypy/branch/cpython-extension/pypy/module/cpyext/pycobject.py
Log:
Load bridge with RTLD_GLOBAL because we do not use "import libs" on posix with distutils. Fix cast.

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	Sun Apr 11 23:19:03 2010
@@ -495,7 +495,7 @@
 
     # load the bridge, and init structure
     import ctypes
-    bridge = ctypes.CDLL(str(modulename))
+    bridge = ctypes.CDLL(str(modulename), mode=ctypes.RTLD_GLOBAL)
     pypyAPI = ctypes.POINTER(ctypes.c_void_p).in_dll(bridge, 'pypyAPI')
 
     # populate static data

Modified: pypy/branch/cpython-extension/pypy/module/cpyext/pycobject.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/pycobject.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/pycobject.py	Sun Apr 11 23:19:03 2010
@@ -29,7 +29,7 @@
     def __del__(self):
         if self.pyo and self.pyo.c_destructor:
             if self.desc:
-                rffi.cast(self.pyo.c_destructor, destructor_long)(self.pyo, self.desc)
+                rffi.cast(destructor_long, self.pyo.c_destructor)(self.pyo, self.desc)
             else:
                 self.pyo.c_destructor(self.voidp)
 



More information about the Pypy-commit mailing list