[pypy-svn] r74987 - pypy/trunk/pypy/module/cpyext

afa at codespeak.net afa at codespeak.net
Tue Jun 1 00:17:07 CEST 2010


Author: afa
Date: Tue Jun  1 00:17:05 2010
New Revision: 74987

Modified:
   pypy/trunk/pypy/module/cpyext/api.py
Log:
small clean-up


Modified: pypy/trunk/pypy/module/cpyext/api.py
==============================================================================
--- pypy/trunk/pypy/module/cpyext/api.py	(original)
+++ pypy/trunk/pypy/module/cpyext/api.py	Tue Jun  1 00:17:05 2010
@@ -594,10 +594,10 @@
     functions = generate_decls_and_callbacks(db, export_symbols)
 
     global_objects = []
-    for name, (type, expr) in GLOBALS.iteritems():
+    for name, (typ, expr) in GLOBALS.iteritems():
         if "#" in name:
             continue
-        global_objects.append('%s %s = NULL;' % (type, name.replace("#", "")))
+        global_objects.append('%s %s = NULL;' % (typ, name))
     global_code = '\n'.join(global_objects)
 
     prologue = "#include <Python.h>\n"
@@ -772,9 +772,9 @@
     # Generate definitions for global structures
     struct_file = udir.join('pypy_structs.c')
     structs = ["#include <Python.h>"]
-    for name, (type, expr) in GLOBALS.iteritems():
+    for name, (typ, expr) in GLOBALS.iteritems():
         if name.endswith('#'):
-            structs.append('%s %s;' % (type[:-1], name[:-1]))
+            structs.append('%s %s;' % (typ[:-1], name[:-1]))
     struct_file.write('\n'.join(structs))
 
     eci = ExternalCompilationInfo(
@@ -817,12 +817,12 @@
     setup_va_functions(eci)
 
     # populate static data
-    for name, (type, expr) in GLOBALS.iteritems():
+    for name, (typ, expr) in GLOBALS.iteritems():
         name = name.replace("#", "")
         from pypy.module import cpyext
         w_obj = eval(expr)
         struct_ptr = make_ref(space, w_obj)
-        struct = rffi.cast(get_structtype_for_ctype(type), struct_ptr)._obj
+        struct = rffi.cast(get_structtype_for_ctype(typ), struct_ptr)._obj
         struct._compilation_info = eci
         export_struct(name, struct)
 



More information about the Pypy-commit mailing list