mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
This commit is contained in:
parent
a8c360ee76
commit
6f2df4d5e1
132 changed files with 1070 additions and 1080 deletions
|
@ -9,7 +9,7 @@ _numFailed = 0
|
|||
|
||||
def testChunk(t, fileName):
|
||||
global _numFailed
|
||||
print '----', fileName,
|
||||
print('----', fileName, end=' ')
|
||||
try:
|
||||
ast = parser.suite(t)
|
||||
tup = parser.ast2tuple(ast)
|
||||
|
@ -18,17 +18,17 @@ def testChunk(t, fileName):
|
|||
ast = None
|
||||
new = parser.tuple2ast(tup)
|
||||
except parser.ParserError as err:
|
||||
print
|
||||
print 'parser module raised exception on input file', fileName + ':'
|
||||
print()
|
||||
print('parser module raised exception on input file', fileName + ':')
|
||||
traceback.print_exc()
|
||||
_numFailed = _numFailed + 1
|
||||
else:
|
||||
if tup != parser.ast2tuple(new):
|
||||
print
|
||||
print 'parser module failed on input file', fileName
|
||||
print()
|
||||
print('parser module failed on input file', fileName)
|
||||
_numFailed = _numFailed + 1
|
||||
else:
|
||||
print 'o.k.'
|
||||
print('o.k.')
|
||||
|
||||
def testFile(fileName):
|
||||
t = open(fileName).read()
|
||||
|
@ -41,7 +41,7 @@ def test():
|
|||
import glob
|
||||
args = glob.glob("*.py")
|
||||
args.sort()
|
||||
map(testFile, args)
|
||||
list(map(testFile, args))
|
||||
sys.exit(_numFailed != 0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue