Commit 0447cd6f authored by Nick Coghlan's avatar Nick Coghlan

Correctly restore sys.stdout in test_descr

parent 19e6f016
...@@ -4311,6 +4311,7 @@ order (MRO) for bases """ ...@@ -4311,6 +4311,7 @@ order (MRO) for bases """
def test_file_fault(self): def test_file_fault(self):
# Testing sys.stdout is changed in getattr... # Testing sys.stdout is changed in getattr...
import sys import sys
test_stdout = sys.stdout
class StdoutGuard: class StdoutGuard:
def __getattr__(self, attr): def __getattr__(self, attr):
sys.stdout = sys.__stdout__ sys.stdout = sys.__stdout__
...@@ -4320,6 +4321,8 @@ order (MRO) for bases """ ...@@ -4320,6 +4321,8 @@ order (MRO) for bases """
print "Oops!" print "Oops!"
except RuntimeError: except RuntimeError:
pass pass
finally:
sys.stdout = test_stdout
def test_vicious_descriptor_nonsense(self): def test_vicious_descriptor_nonsense(self):
# Testing vicious_descriptor_nonsense... # Testing vicious_descriptor_nonsense...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment