summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2008-10-07 15:03:40 (GMT)
committerSkip Montanaro <skip@pobox.com>2008-10-07 15:03:40 (GMT)
commit7d9d7a265955d7a9988d7dff18b7e138910de8b2 (patch)
tree44a5436cb2cd5d8141b5f62490f85fd3f9933bc9 /Lib/test
parenta46ed915fa4b9b667fcc164a2762e69e184cbafe (diff)
downloadcpython-7d9d7a265955d7a9988d7dff18b7e138910de8b2.zip
cpython-7d9d7a265955d7a9988d7dff18b7e138910de8b2.tar.gz
cpython-7d9d7a265955d7a9988d7dff18b7e138910de8b2.tar.bz2
save/restore stdout/stderr instead of relying on __*__ versions
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_atexit.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py
index 3c6043d..0ff6e53 100644
--- a/Lib/test/test_atexit.py
+++ b/Lib/test/test_atexit.py
@@ -7,13 +7,15 @@ from test import test_support
class TestCase(unittest.TestCase):
def setUp(self):
s = StringIO.StringIO()
+ self.save_stdout = sys.stdout
+ self.save_stderr = sys.stderr
sys.stdout = sys.stderr = self.subst_io = s
self.save_handlers = atexit._exithandlers
atexit._exithandlers = []
def tearDown(self):
- sys.stdout = sys.__stdout__
- sys.stderr = sys.__stderr__
+ sys.stdout = self.save_stdout
+ sys.stderr = self.save_stderr
atexit._exithandlers = self.save_handlers
def test_args(self):