]> git.ipfire.org Git - thirdparty/Python/cpython.git/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:50:33 +0000 (12:50 +0000)
committerSamuele Pedroni <pedronis@openend.se>
Sat, 17 May 2003 12:50:33 +0000 (12:50 +0000)
Lib/test/test_codeop.py

index b98989a703b907a30849402b73c697b986cd608a..b9e7e26c9f0ee0b77b7b0006e815d833aad4883a 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) }