fixed stdout alteration in test_distutils

This commit is contained in:
Tarek Ziadé 2009-11-01 22:33:45 +00:00
parent 84ee9e257e
commit 9c48da74bc
2 changed files with 6 additions and 1 deletions

View 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_dont_write_bytecode(self):
# makes sure byte_compile is not used