2 # (Force the script to use the latest build.)
6 import parser
, traceback
10 def testChunk(t
, fileName
):
12 print '----', fileName
,
15 tup
= parser
.ast2tuple(ast
)
16 # this discards the first AST; a huge memory savings when running
17 # against a large source file like Tkinter.py.
19 new
= parser
.tuple2ast(tup
)
20 except parser
.ParserError
, err
:
22 print 'parser module raised exception on input file', fileName
+ ':'
24 _numFailed
= _numFailed
+ 1
26 if tup
!= parser
.ast2tuple(new
):
28 print 'parser module failed on input file', fileName
29 _numFailed
= _numFailed
+ 1
33 def testFile(fileName
):
34 t
= open(fileName
).read()
35 testChunk(t
, fileName
)
42 args
= glob
.glob("*.py")
45 sys
.exit(_numFailed
!= 0)
47 if __name__
== '__main__':