Amaury Forgeot d'Arc avatar Amaury Forgeot d'Arc committed a8df6e2

Rename objects in one place

Comments (0)

Files changed (1)

pypy/module/cpyext/api.py

 
     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)
 
         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
 
 
     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)
 
 
     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)
 
     db = LowLevelDatabase()
 
     generate_macros(export_symbols, rename=True)
+    for obj in GLOBALS.values():
+        obj.name = obj.name.replace('Py', 'PyPy')
 
     # Structure declaration code
     members = []
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.