[pypy-svn] r7557 - pypy/trunk/src/pypy/translator

arigo at codespeak.net arigo at codespeak.net
Mon Nov 22 13:44:22 CET 2004


Author: arigo
Date: Mon Nov 22 13:44:22 2004
New Revision: 7557

Modified:
   pypy/trunk/src/pypy/translator/genc.py
Log:
Fixed nameof_staticmethod() to not generate the same function twice.


Modified: pypy/trunk/src/pypy/translator/genc.py
==============================================================================
--- pypy/trunk/src/pypy/translator/genc.py	(original)
+++ pypy/trunk/src/pypy/translator/genc.py	Mon Nov 22 13:44:22 2004
@@ -210,16 +210,12 @@
     def nameof_staticmethod(self, sm):
         # XXX XXX XXXX
         func = sm.__get__(42.5)
-        if self.translator.frozen:
-            assert func in self.translator.flowgraphs, func
-            
         name = self.uniquename('gsm_' + func.__name__)
+        functionname = self.nameof(func)
         self.initcode.append('INITCHK(%s = PyCFunction_New('
-                             '&ml_%s, NULL))' % (name, name))
-        self.pendingfunctions.append(func)
+                             '&ml_%s, NULL))' % (name, functionname))
         return name
 
-
     def nameof_instancemethod(self, meth):
         if meth.im_self is None:
             # no error checking here



More information about the Pypy-commit mailing list