[pypy-svn] r73871 - pypy/trunk/pypy/interpreter
benjamin at codespeak.net
benjamin at codespeak.net
Sun Apr 18 05:57:01 CEST 2010
Author: benjamin
Date: Sun Apr 18 05:56:59 2010
New Revision: 73871
Modified:
pypy/trunk/pypy/interpreter/function.py
pypy/trunk/pypy/interpreter/gateway.py
Log:
must add functions to global table for stackless happiness
Modified: pypy/trunk/pypy/interpreter/function.py
==============================================================================
--- pypy/trunk/pypy/interpreter/function.py (original)
+++ pypy/trunk/pypy/interpreter/function.py Sun Apr 18 05:56:59 2010
@@ -240,9 +240,12 @@
identifier = self.code.identifier
assert Function._all.get(identifier, self) is self, ("duplicate "
"function ids")
- Function._all[identifier] = self
+ self.add_to_table()
return False
+ def add_to_table(self):
+ Function._all[self.code.identifier] = self
+
def find(identifier):
return Function._all[identifier]
find = staticmethod(find)
Modified: pypy/trunk/pypy/interpreter/gateway.py
==============================================================================
--- pypy/trunk/pypy/interpreter/gateway.py (original)
+++ pypy/trunk/pypy/interpreter/gateway.py Sun Apr 18 05:56:59 2010
@@ -801,6 +801,8 @@
defs = gateway._getdefaults(space) # needs to be implemented by subclass
code = gateway._code
fn = FunctionWithFixedCode(space, code, None, defs, forcename = gateway.name)
+ if not space.config.translating:
+ fn.add_to_table()
if gateway.as_classmethod:
fn = ClassMethod(space.wrap(fn))
return fn
More information about the Pypy-commit
mailing list