[pypy-commit] pypy default: (fijal, arigo)

arigo pypy.commits at gmail.com
Wed Aug 23 12:23:47 EDT 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r92228:18b10a6743c4
Date: 2017-08-23 18:21 +0200
http://bitbucket.org/pypy/pypy/changeset/18b10a6743c4/

Log:	(fijal, arigo)

	Rename _pypy_dll to __pypy_dll__, so that the custom __getattr__
	would raise if the attribute doesn't exist

diff --git a/lib-python/2.7/ctypes/__init__.py b/lib-python/2.7/ctypes/__init__.py
--- a/lib-python/2.7/ctypes/__init__.py
+++ b/lib-python/2.7/ctypes/__init__.py
@@ -364,7 +364,7 @@
                 pypy_dll = _ffi.CDLL(name, mode)
             else:
                 pypy_dll = _ffi.WinDLL(name, mode)
-            self._pypy_dll = pypy_dll
+            self.__pypy_dll__ = pypy_dll
             handle = int(pypy_dll)
             if _sys.maxint > 2 ** 32:
                 handle = int(handle)   # long -> int
diff --git a/lib_pypy/_ctypes/basics.py b/lib_pypy/_ctypes/basics.py
--- a/lib_pypy/_ctypes/basics.py
+++ b/lib_pypy/_ctypes/basics.py
@@ -82,7 +82,7 @@
         return False
 
     def in_dll(self, dll, name):
-        return self.from_address(dll._pypy_dll.getaddressindll(name))
+        return self.from_address(dll.__pypy_dll__.getaddressindll(name))
 
     def from_buffer(self, obj, offset=0):
         size = self._sizeofinstances()
diff --git a/lib_pypy/_ctypes/function.py b/lib_pypy/_ctypes/function.py
--- a/lib_pypy/_ctypes/function.py
+++ b/lib_pypy/_ctypes/function.py
@@ -430,7 +430,7 @@
             ffires = restype.get_ffi_argtype()
             return _ffi.FuncPtr.fromaddr(ptr, '', ffiargs, ffires, self._flags_)
 
-        cdll = self.dll._pypy_dll
+        cdll = self.dll.__pypy_dll__
         try:
             ffi_argtypes = [argtype.get_ffi_argtype() for argtype in argtypes]
             ffi_restype = restype.get_ffi_argtype()


More information about the pypy-commit mailing list