From: Tarek Ziadé Date: Sun, 1 Nov 2009 22:38:44 +0000 (+0000) Subject: Merged revisions 76042 via svnmerge from X-Git-Tag: v3.2a1~2250 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f9197f95518756386f04023f954976c2be010f8;p=thirdparty%2FPython%2Fcpython.git Merged revisions 76042 via svnmerge from 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 ........ --- diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py index 582f24634ab4..3e45f6e89e92 100644 --- a/Lib/distutils/tests/test_build_py.py +++ b/Lib/distutils/tests/test_build_py.py @@ -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 = io.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_dont_write_bytecode(self): # makes sure byte_compile is not used diff --git a/Lib/distutils/tests/test_util.py b/Lib/distutils/tests/test_util.py index a2f8ed2b5933..417247265840 100644 --- a/Lib/distutils/tests/test_util.py +++ b/Lib/distutils/tests/test_util.py @@ -60,6 +60,8 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase): util.find_executable = self._find_executable self._exes = {} self.old_popen = subprocess.Popen + self.old_stdout = sys.stdout + self.old_stderr = sys.stderr FakePopen.test_class = self subprocess.Popen = FakePopen @@ -79,6 +81,8 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase): sysconfig._config_vars = copy(self._config_vars) util.find_executable = self.old_find_executable subprocess.Popen = self.old_popen + sys.old_stdout = self.old_stdout + sys.old_stderr = self.old_stderr super(UtilTestCase, self).tearDown() def _set_uname(self, uname):