Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a73278

Browse files
committed
#2725: Fix missing local, and handle errors without tracebacks.
1 parent 406b3d8 commit 8a73278

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Parser/asdl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ def parse(file):
405405
try:
406406
return parser.parse(tokens)
407407
except ASDLSyntaxError:
408-
output(sys.exc_info()[1])
408+
err = sys.exc_info()[1]
409+
output(str(err))
409410
lines = buf.split("\n")
410411
output(lines[err.lineno - 1]) # lines starts at 0, files at 1
411412

@@ -422,6 +423,8 @@ def parse(file):
422423
for file in files:
423424
output(file)
424425
mod = parse(file)
426+
if not mod:
427+
break
425428
output("module", mod.name)
426429
output(len(mod.dfns), "definitions")
427430
if not check(mod):

0 commit comments

Comments
 (0)