]> granicus.if.org Git - python/commitdiff
Merged revisions 76042 via svnmerge from
authorTarek Ziadé <ziade.tarek@gmail.com>
Sun, 1 Nov 2009 23:17:51 +0000 (23:17 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Sun, 1 Nov 2009 23:17:51 +0000 (23:17 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76042 | tarek.ziade | 2009-11-01 23:33:45 +0100 (Sun, 01 Nov 2009) | 1 line

  fixed stdout alteration in test_distutils
........

Lib/distutils/tests/test_build_py.py

index 54a4ed80fd30bc3a20c370ba7c51b7d0cddf1d31..4b045474f1c74e320c711abe94fb77b39311c703 100644 (file)
@@ -69,6 +69,7 @@ class BuildPyTestCase(support.TempdirManager,
         open(os.path.join(testdir, "testfile"), "w").close()
 
         os.chdir(sources)
+        old_stdout = sys.stdout
         sys.stdout = StringIO.StringIO()
 
         try:
@@ -87,7 +88,7 @@ class BuildPyTestCase(support.TempdirManager,
         finally:
             # Restore state.
             os.chdir(cwd)
-            sys.stdout = sys.__stdout__
+            sys.stdout = old_stdout
 
 def test_suite():
     return unittest.makeSuite(BuildPyTestCase)