[pypy-svn] r13550 - pypy/dist/pypy/translator/pickle
tismer at codespeak.net
tismer at codespeak.net
Fri Jun 17 19:48:45 CEST 2005
Author: tismer
Date: Fri Jun 17 19:48:44 2005
New Revision: 13550
Modified:
pypy/dist/pypy/translator/pickle/genpickle.py
Log:
loading and saving now works with targetrpystone.
The reloaded graph compiles and runs!
Modified: pypy/dist/pypy/translator/pickle/genpickle.py
==============================================================================
--- pypy/dist/pypy/translator/pickle/genpickle.py (original)
+++ pypy/dist/pypy/translator/pickle/genpickle.py Fri Jun 17 19:48:44 2005
@@ -80,6 +80,7 @@
'pypy._cache.',
'pypy.interpreter.',
'pypy.module.',
+ 'pypy.translator.test.',
'__main__',
)
self.shortnames = {
@@ -260,6 +261,7 @@
text = 'skipped, see _skipped_code attr: %s' % funcname
def dummy(*args, **kwds):
raise NotImplementedError, text
+ _dummydict['__builtins__'] = __builtins__
skippedfunc = new.function(dummy.func_code, _dummydict, skipname, (),
dummy.func_closure)
skippedfunc._skipped_code = func_code
@@ -478,12 +480,12 @@
self.produce(line)
return name
- def is_app_domain(self, modname):
+ def is_app_domain(self, modname, exclude=()):
for domain in self.domains:
if domain.endswith('.') and modname.startswith(domain):
# handle subpaths
return True
- if modname == domain:
+ if modname == domain and modname not in exclude:
# handle exact module names
return True
return False
@@ -681,7 +683,7 @@
if func not in self.translator.flowgraphs:
# see if this is in translator's domain
module = whichmodule(func, func.__name__)
- if self.is_app_domain(module):
+ if self.is_app_domain(module, exclude=['__main__']):
# see if this buddy has been skipped in another save, before
if not hasattr(func, '_skipped_code'):
return self.skipped_function(func,
More information about the Pypy-commit
mailing list