[pypy-svn] r64104 - pypy/branch/wip-fix-stackless-O2-pickling/pypy/translator
pedronis at codespeak.net
pedronis at codespeak.net
Wed Apr 15 17:58:42 CEST 2009
Author: pedronis
Date: Wed Apr 15 17:58:42 2009
New Revision: 64104
Modified:
pypy/branch/wip-fix-stackless-O2-pickling/pypy/translator/geninterplevel.py
Log:
(cfbolz, pedronis)
trying to have geninterp help with having unique function names
Modified: pypy/branch/wip-fix-stackless-O2-pickling/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/branch/wip-fix-stackless-O2-pickling/pypy/translator/geninterplevel.py (original)
+++ pypy/branch/wip-fix-stackless-O2-pickling/pypy/translator/geninterplevel.py Wed Apr 15 17:58:42 2009
@@ -1231,6 +1231,7 @@
def install_func(f_name, name):
yield ''
yield ' %s = %s' % (f_name, name)
+ yield ' %s.__name__ = %r' % (f_name, f_name)
#import __builtin__
#dic = __builtin__.__dict__
#if dic.get(name):
@@ -1403,7 +1404,7 @@
RPY_SEP = "#*************************************************************"
RPY_INIT_HEADER = RPY_SEP + '''
-#__name__ = %(modname)r
+__name__ = "_geninterp_"+%(modname)r
_geninterp_ = True
def init%(modname)s(space):
@@ -1536,7 +1537,7 @@
newsrc = f.read()
f.close()
code = py.code.Source(newsrc).compile()
- dic = {'__name__': modname}
+ dic = {}
exec code in dic
# now we just need to return the init function,
# which then needs to be called with the space to return the dict.
More information about the Pypy-commit
mailing list