Get rid of the increasingly convoluted global tricks w/ sys.stdout, in

favor of local save/modify/restore.  The test suite should run fine again.
This commit is contained in:
Tim Peters 2001-09-25 19:13:20 +00:00
parent 5055545fc0
commit 342ca75d95
2 changed files with 12 additions and 28 deletions

View file

@ -287,7 +287,7 @@ def runtest(test, generate, verbose, quiet, testdir = None):
else:
cfp = StringIO.StringIO()
try:
sys.save_stdout = sys.stdout
save_stdout = sys.stdout
try:
if cfp:
sys.stdout = cfp
@ -301,7 +301,7 @@ def runtest(test, generate, verbose, quiet, testdir = None):
if indirect_test is not None:
indirect_test()
finally:
sys.stdout = sys.save_stdout
sys.stdout = save_stdout
except (ImportError, test_support.TestSkipped), msg:
if not quiet:
print "test", test, "skipped --", msg