diff -r 5ea81e4c58a7 Lib/lib2to3/tests/test_parser.py --- a/Lib/lib2to3/tests/test_parser.py Mon Oct 17 20:44:22 2011 +0200 +++ b/Lib/lib2to3/tests/test_parser.py Tue Oct 18 13:54:24 2011 +0300 @@ -15,6 +15,8 @@ # Python imports import os import unittest +import warnings +import subprocess # Local imports from lib2to3.pgen2 import tokenize @@ -171,7 +173,7 @@ try: tree = driver.parse_string(source) except ParseError as err: - print('ParseError on file', filepath, err) + warnings.warn('ParseError on file %s (%s)' % (filepath, err)) continue new = str(tree) if diff(filepath, new): @@ -183,6 +185,7 @@ driver.parse_string("(z, *y, w) = m\n") driver.parse_string("for *z, m in d: pass\n") + class TestLiterals(GrammarTest): def validate(self, s): @@ -221,7 +224,7 @@ with open('@', 'w') as f: f.write(str(result)) fn = fn.replace('"', '\\"') - return os.system('diff -u "%s" @' % fn) + return subprocess.getoutput('diff -u "%s" @' % fn) finally: try: os.remove("@")