mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
Correctly restore sys.stdout in test_descr
This commit is contained in:
parent
19e6f0160d
commit
0447cd6fdc
1 changed files with 3 additions and 0 deletions
|
@ -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...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue