diff options
author | Georg Brandl <georg@python.org> | 2009-04-12 11:34:13 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-12 11:34:13 (GMT) |
commit | 8a73278cd897e72a5721c3f608d7bd115bada8c1 (patch) | |
tree | 768cfab2af82729acf445a1efb92de04bd25bbeb /Parser/asdl.py | |
parent | 406b3d89e2ba94d013309884ba6fb9cb69ec5a75 (diff) | |
download | cpython-8a73278cd897e72a5721c3f608d7bd115bada8c1.zip cpython-8a73278cd897e72a5721c3f608d7bd115bada8c1.tar.gz cpython-8a73278cd897e72a5721c3f608d7bd115bada8c1.tar.bz2 |
#2725: Fix missing local, and handle errors without tracebacks.
Diffstat (limited to 'Parser/asdl.py')
-rw-r--r-- | Parser/asdl.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Parser/asdl.py b/Parser/asdl.py index 418ac57..ce9d0d3 100644 --- a/Parser/asdl.py +++ b/Parser/asdl.py @@ -405,7 +405,8 @@ def parse(file): try: return parser.parse(tokens) except ASDLSyntaxError: - output(sys.exc_info()[1]) + err = sys.exc_info()[1] + output(str(err)) lines = buf.split("\n") output(lines[err.lineno - 1]) # lines starts at 0, files at 1 @@ -422,6 +423,8 @@ if __name__ == "__main__": for file in files: output(file) mod = parse(file) + if not mod: + break output("module", mod.name) output(len(mod.dfns), "definitions") if not check(mod): |