From: Samuele Pedroni Date: Sat, 17 May 2003 12:50:33 +0000 (+0000) Subject: minor fix, jython-only. Don't asssume stdout to save is the ur-stdout. X-Git-Tag: v2.2.3c1~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ea0a1866952c0423589382bb33c5da170b1d093;p=thirdparty%2FPython%2Fcpython.git minor fix, jython-only. Don't asssume stdout to save is the ur-stdout. --- diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index b98989a703b9..b9e7e26c9f0e 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -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,"","single") in r finally: - sys.stdout = sys.__stdout__ + sys.stdout = saved_stdout elif symbol == 'eval': ctx = {'a': 2} d = { 'value': eval(code,ctx) }