Commit 72c5c77c authored by Samuele Pedroni's avatar Samuele Pedroni

minor fix, jython-only. Don't asssume stdout to save is the ur-stdout.

parent a98924a0
...@@ -26,12 +26,13 @@ class CodeopTests(unittest.TestCase): ...@@ -26,12 +26,13 @@ class CodeopTests(unittest.TestCase):
self.assert_(code) self.assert_(code)
if symbol == "single": if symbol == "single":
d,r = {},{} d,r = {},{}
saved_stdout = sys.stdout
sys.stdout = cStringIO.StringIO() sys.stdout = cStringIO.StringIO()
try: try:
exec code in d exec code in d
exec compile(str,"<input>","single") in r exec compile(str,"<input>","single") in r
finally: finally:
sys.stdout = sys.__stdout__ sys.stdout = saved_stdout
elif symbol == 'eval': elif symbol == 'eval':
ctx = {'a': 2} ctx = {'a': 2}
d = { 'value': eval(code,ctx) } d = { 'value': eval(code,ctx) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment