[pypy-svn] r75225 - pypy/branch/cpyext-init-cleanup/pypy/module/cpyext

afa at codespeak.net afa at codespeak.net
Wed Jun 9 00:25:22 CEST 2010


Author: afa
Date: Wed Jun  9 00:25:21 2010
New Revision: 75225

Modified:
   pypy/branch/cpyext-init-cleanup/pypy/module/cpyext/api.py
Log:
Rename objects in one place


Modified: pypy/branch/cpyext-init-cleanup/pypy/module/cpyext/api.py
==============================================================================
--- pypy/branch/cpyext-init-cleanup/pypy/module/cpyext/api.py	(original)
+++ pypy/branch/cpyext-init-cleanup/pypy/module/cpyext/api.py	Wed Jun  9 00:25:21 2010
@@ -394,8 +394,7 @@
 
     def set_value_in_ctypes_dll(self, space, dll, value):
         # it's a structure, get its adress
-        name = self.name.replace('Py', 'PyPy')
-        in_dll = ll2ctypes.get_ctypes_type(PyObject.TO).in_dll(dll, name)
+        in_dll = ll2ctypes.get_ctypes_type(PyObject.TO).in_dll(dll, self.name)
         py_obj = ll2ctypes.ctypes2lltype(PyObject, ctypes.pointer(in_dll))
         attach_and_track(space, py_obj, value)
 
@@ -416,8 +415,7 @@
         return rffi.cast(lltype.Ptr(PyDateTime_CAPI), value)._obj
 
     def set_value_in_ctypes_dll(self, space, dll, value):
-        name = self.name.replace('Py', 'PyPy')
-        ptr = ctypes.c_void_p.in_dll(dll, name)
+        ptr = ctypes.c_void_p.in_dll(dll, self.name)
         ptr.value = ctypes.cast(ll2ctypes.lltype2ctypes(value),
                                 ctypes.c_void_p).value
 
@@ -441,8 +439,7 @@
 
     def set_value_in_ctypes_dll(self, space, dll, value):
         # it's a pointer
-        name = self.name.replace('Py', 'PyPy')
-        in_dll = ll2ctypes.get_ctypes_type(PyObject).in_dll(dll, name)
+        in_dll = ll2ctypes.get_ctypes_type(PyObject).in_dll(dll, self.name)
         py_obj = ll2ctypes.ctypes2lltype(PyObject, in_dll)
         attach_and_track(space, py_obj, value)
 
@@ -465,8 +462,7 @@
 
     def set_value_in_ctypes_dll(self, space, dll, value):
         # it's a structure, get its adress
-        name = self.name.replace('Py', 'PyPy')
-        in_dll = ll2ctypes.get_ctypes_type(PyObject.TO).in_dll(dll, name)
+        in_dll = ll2ctypes.get_ctypes_type(PyObject.TO).in_dll(dll, self.name)
         py_obj = ll2ctypes.ctypes2lltype(PyObject, ctypes.pointer(in_dll))
         attach_and_track(space, py_obj, value)
 
@@ -725,6 +721,8 @@
     db = LowLevelDatabase()
 
     generate_macros(export_symbols, rename=True)
+    for obj in GLOBALS.values():
+        obj.name = obj.name.replace('Py', 'PyPy')
 
     # Structure declaration code
     members = []



More information about the Pypy-commit mailing list