[pypy-svn] pypy jitypes2: enable _ffi for ctypes also in the 2.7.0 lib

antocuni commits-noreply at bitbucket.org
Mon Jan 17 18:22:56 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r40794:a1517fe7e5f1
Date: 2011-01-17 14:49 +0100
http://bitbucket.org/pypy/pypy/changeset/a1517fe7e5f1/

Log:	enable _ffi for ctypes also in the 2.7.0 lib

diff --git a/lib-python/modified-2.7.0/ctypes/__init__.py b/lib-python/modified-2.7.0/ctypes/__init__.py
--- a/lib-python/modified-2.7.0/ctypes/__init__.py
+++ b/lib-python/modified-2.7.0/ctypes/__init__.py
@@ -7,6 +7,7 @@
 
 __version__ = "1.1.0"
 
+import _ffi
 from _ctypes import Union, Structure, Array
 from _ctypes import _Pointer
 from _ctypes import CFuncPtr as _CFuncPtr
@@ -349,8 +350,9 @@
             _restype_ = self._func_restype_
         self._FuncPtr = _FuncPtr
 
-        if handle is None:
-            self._handle = _dlopen(self._name, mode)
+        if handle is None and name is not None:
+            #self._handle = _dlopen(self._name, mode)
+            self._handle = _ffi.CDLL(name)
         else:
             self._handle = handle
 


More information about the Pypy-commit mailing list