]> granicus.if.org Git - python/commitdiff
minor fix, jython-only. Don't asssume stdout to save is the ur-stdout.
authorSamuele Pedroni <pedronis@openend.se>
Sat, 17 May 2003 12:51:10 +0000 (12:51 +0000)
committerSamuele Pedroni <pedronis@openend.se>
Sat, 17 May 2003 12:51:10 +0000 (12:51 +0000)
Lib/test/test_codeop.py

index c2f8539ddbfcd3c87af45ba66f4e255ba5f25dc8..630af49c72dda4c2da99a74c55245d67d057a91e 100644 (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) }