[Python-checkins] r75453 - python/trunk/Lib/test/test_descr.py

nick.coghlan python-checkins at python.org
Sat Oct 17 08:33:05 CEST 2009


Author: nick.coghlan
Date: Sat Oct 17 08:33:05 2009
New Revision: 75453

Log:
Correctly restore sys.stdout in test_descr

Modified:
   python/trunk/Lib/test/test_descr.py

Modified: python/trunk/Lib/test/test_descr.py
==============================================================================
--- python/trunk/Lib/test/test_descr.py	(original)
+++ python/trunk/Lib/test/test_descr.py	Sat Oct 17 08:33:05 2009
@@ -4311,6 +4311,7 @@
     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 @@
             print "Oops!"
         except RuntimeError:
             pass
+        finally:
+            sys.stdout = test_stdout
 
     def test_vicious_descriptor_nonsense(self):
         # Testing vicious_descriptor_nonsense...


More information about the Python-checkins mailing list