mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Make Demo/parser/test_parser.py run.
This commit is contained in:
parent
feb3b75818
commit
6a4e3c5f12
1 changed files with 6 additions and 6 deletions
|
@ -11,19 +11,19 @@ def testChunk(t, fileName):
|
||||||
global _numFailed
|
global _numFailed
|
||||||
print('----', fileName, end=' ')
|
print('----', fileName, end=' ')
|
||||||
try:
|
try:
|
||||||
ast = parser.suite(t)
|
st = parser.suite(t)
|
||||||
tup = parser.ast2tuple(ast)
|
tup = parser.st2tuple(st)
|
||||||
# this discards the first AST; a huge memory savings when running
|
# this discards the first ST; a huge memory savings when running
|
||||||
# against a large source file like Tkinter.py.
|
# against a large source file like Tkinter.py.
|
||||||
ast = None
|
st = None
|
||||||
new = parser.tuple2ast(tup)
|
new = parser.tuple2st(tup)
|
||||||
except parser.ParserError as err:
|
except parser.ParserError as err:
|
||||||
print()
|
print()
|
||||||
print('parser module raised exception on input file', fileName + ':')
|
print('parser module raised exception on input file', fileName + ':')
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
_numFailed = _numFailed + 1
|
_numFailed = _numFailed + 1
|
||||||
else:
|
else:
|
||||||
if tup != parser.ast2tuple(new):
|
if tup != parser.st2tuple(new):
|
||||||
print()
|
print()
|
||||||
print('parser module failed on input file', fileName)
|
print('parser module failed on input file', fileName)
|
||||||
_numFailed = _numFailed + 1
|
_numFailed = _numFailed + 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue