diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2009-10-17 06:33:05 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2009-10-17 06:33:05 (GMT) |
commit | 0447cd6fdc9b7d179c729fb43df55eeab8173dcc (patch) | |
tree | 8c683308faa12e9411ab921f4a3dbf86888b0c34 | |
parent | 19e6f0160d4087e8412ef5b740b826ff6c3d584e (diff) | |
download | cpython-0447cd6fdc9b7d179c729fb43df55eeab8173dcc.zip cpython-0447cd6fdc9b7d179c729fb43df55eeab8173dcc.tar.gz cpython-0447cd6fdc9b7d179c729fb43df55eeab8173dcc.tar.bz2 |
Correctly restore sys.stdout in test_descr
-rw-r--r-- | Lib/test/test_descr.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 00f19ce..0b21f57 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4311,6 +4311,7 @@ order (MRO) for bases """ def test_file_fault(self): # Testing sys.stdout is changed in getattr... import sys + test_stdout = sys.stdout class StdoutGuard: def __getattr__(self, attr): sys.stdout = sys.__stdout__ @@ -4320,6 +4321,8 @@ order (MRO) for bases """ print "Oops!" except RuntimeError: pass + finally: + sys.stdout = test_stdout def test_vicious_descriptor_nonsense(self): # Testing vicious_descriptor_nonsense... |