提交 da5780bb authored 作者: Frederic Bastien's avatar Frederic Bastien

more backport.

上级 8ef9a3f0
...@@ -393,16 +393,17 @@ class T_picklefunction(unittest.TestCase): ...@@ -393,16 +393,17 @@ class T_picklefunction(unittest.TestCase):
old_default_opt = config.optimizer old_default_opt = config.optimizer
old_default_link = config.linker old_default_link = config.linker
try: try:
str_f = cPickle.dumps(f) try:
config.mode = 'Mode' str_f = cPickle.dumps(f)
config.linker = 'py' config.mode = 'Mode'
config.optimizer = 'None' config.linker = 'py'
g = cPickle.loads(str_f) config.optimizer = 'None'
#print g.maker.mode g = cPickle.loads(str_f)
#print compile.mode.default_mode #print g.maker.mode
except NotImplementedError, e: #print compile.mode.default_mode
if e[0].startswith('DebugMode is not pickl'): except NotImplementedError, e:
g = 'ok' if e[0].startswith('DebugMode is not pickl'):
g = 'ok'
finally: finally:
config.mode = old_default_mode config.mode = old_default_mode
config.optimizer = old_default_opt config.optimizer = old_default_opt
......
...@@ -7,7 +7,9 @@ def run(TF): ...@@ -7,7 +7,9 @@ def run(TF):
if TF and RUN_TESTS: if TF and RUN_TESTS:
print 'running test', f.__name__ print 'running test', f.__name__
f() f()
return f if RUN_TESTS else None if RUN_TESTS:
return f
else: return None
return deco return deco
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论