changeset: 83664:63f2941477d3 branch: 2.7 parent: 83661:a285ce18bd55 user: Ezio Melotti date: Tue May 07 09:34:49 2013 +0300 files: Lib/test/test_tcl.py description: #17833: add debug output to investigate buildbot failure. diff -r a285ce18bd55 -r 63f2941477d3 Lib/test/test_tcl.py --- a/Lib/test/test_tcl.py Mon May 06 18:21:10 2013 -0700 +++ b/Lib/test/test_tcl.py Tue May 07 09:34:49 2013 +0300 @@ -4,6 +4,7 @@ import sys import os from test import test_support +from subprocess import Popen, PIPE # Skip this test if the _tkinter module wasn't built. _tkinter = test_support.import_module('_tkinter') @@ -146,11 +147,20 @@ with test_support.EnvironmentVarGuard() as env: env.unset("TCL_LIBRARY") - f = os.popen('%s -c "import Tkinter; print Tkinter"' % (unc_name,)) + cmd = '%s -c "import Tkinter; print Tkinter"' % (unc_name,) + + p = Popen(cmd, stdout=PIPE, stderr=PIPE) + out_data, err_data = p.communicate() - self.assertIn('Tkinter.py', f.read()) - # exit code must be zero - self.assertEqual(f.close(), None) + msg = '\n\n'.join(['"Tkinter.py" not in output', + 'Command:', cmd, + 'stdout:', out_data, + 'stderr:', err_data]) + + self.assertIn('Tkinter.py', out_data, msg) + + self.assertEqual(p.wait(), 0, 'Non-zero exit code') + def test_passing_values(self): def passValue(value):