0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 08:20:55 +01:00

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

This commit is contained in:
Samuele Pedroni 2003-05-17 12:51:10 +00:00
parent a98924a063
commit 72c5c77ce1

View File

@ -26,12 +26,13 @@ class CodeopTests(unittest.TestCase):
self.assert_(code)
if symbol == "single":
d,r = {},{}
saved_stdout = sys.stdout
sys.stdout = cStringIO.StringIO()
try:
exec code in d
exec compile(str,"<input>","single") in r
finally:
sys.stdout = sys.__stdout__
sys.stdout = saved_stdout
elif symbol == 'eval':
ctx = {'a': 2}
d = { 'value': eval(code,ctx) }