test_atexit: fix code saving/restoring stdout and stderr

That's why I prefer a single instruction per line :-)
This commit is contained in:
Victor Stinner 2011-01-05 23:47:00 +00:00
parent 73efd621fb
commit 457ab068a3
1 changed files with 2 additions and 1 deletions

View File

@ -25,8 +25,9 @@ def raise2():
class TestCase(unittest.TestCase): class TestCase(unittest.TestCase):
def setUp(self): def setUp(self):
self.save_stdout = sys.stdout
self.save_stderr = sys.stderr
self.stream = io.StringIO() self.stream = io.StringIO()
self.save_stdout, self.save_stderr = sys.stderr, sys.stdout
sys.stdout = sys.stderr = self.stream sys.stdout = sys.stderr = self.stream
atexit._clear() atexit._clear()