mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
test_atexit: fix code saving/restoring stdout and stderr
That's why I prefer a single instruction per line :-)
This commit is contained in:
parent
73efd621fb
commit
457ab068a3
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue