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

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


Author: afa
Date: Wed Jun  9 00:22:03 2010
New Revision: 75224

Modified:
   pypy/branch/cpyext-init-cleanup/pypy/module/cpyext/api.py
Log:
more simplification


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:22:03 2010
@@ -369,6 +369,12 @@
             return ['extern %s _%s;' % (self.type[:-1], self.name),
                     '%s %s = (%s)&_%s;' % (type, self.name, type, self.name)]
 
+    def get_global_code_for_bridge(self):
+        if not self.needs_hidden_global_structure:
+            return []
+        else:
+            return ['%s _%s;' % (self.type[:-1], self.name)]
+
 class GlobalStaticPyObject(BaseGlobalObject):
     def __init__(self, name, expr):
         self.name = name
@@ -376,8 +382,6 @@
         self.expr = expr
 
     needs_hidden_global_structure = False
-    def get_global_code_for_bridge(self):
-        return []
     def get_type_for_declaration(self):
         return 'PyObject'
 
@@ -402,8 +406,6 @@
         self.expr = expr
 
     needs_hidden_global_structure = True
-    def get_global_code_for_bridge(self):
-        return ['%s _%s;' % (self.type[:-1], self.name)]
     def get_type_for_declaration(self):
         return self.type
 
@@ -427,8 +429,6 @@
                      % (exc_name,))
 
     needs_hidden_global_structure = True
-    def get_global_code_for_bridge(self):
-        return ['%s _%s;' % (self.type[:-1], self.name)]
     def get_type_for_declaration(self):
         return 'PyObject*'
 
@@ -453,8 +453,6 @@
         self.expr = expr
 
     needs_hidden_global_structure = False
-    def get_global_code_for_bridge(self):
-        return []
     def get_type_for_declaration(self):
         return 'PyTypeObject'
 



More information about the Pypy-commit mailing list