diff options
| author | Georg Brandl <georg@python.org> | 2009-04-12 11:34:13 +0000 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2009-04-12 11:34:13 +0000 |
| commit | e14cd9e93c196cf1700782dec9548a8794299066 (patch) | |
| tree | 274a0e8f8ea3802242193ab1433cfc031f72e416 /Parser | |
| parent | 9d873153104a7b482449ada9a2fd844524853daf (diff) | |
| download | cpython-e14cd9e93c196cf1700782dec9548a8794299066.tar.gz | |
#2725: Fix missing local, and handle errors without tracebacks.
Diffstat (limited to 'Parser')
| -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 418ac5717d..ce9d0d37f5 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): |
