summaryrefslogtreecommitdiff
path: root/Lib/test/test_atexit.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_atexit.py')
-rw-r--r--Lib/test/test_atexit.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py
index 04af9fb143..8a71036fde 100644
--- a/Lib/test/test_atexit.py
+++ b/Lib/test/test_atexit.py
@@ -26,12 +26,13 @@ def raise2():
class TestCase(unittest.TestCase):
def setUp(self):
self.stream = io.StringIO()
+ self.save_stdout, self.save_stderr = sys.stderr, sys.stdout
sys.stdout = sys.stderr = self.stream
atexit._clear()
def tearDown(self):
- sys.stdout = sys.__stdout__
- sys.stderr = sys.__stderr__
+ sys.stdout = self.save_stdout
+ sys.stderr = self.save_stderr
atexit._clear()
def test_args(self):