]> granicus.if.org Git - python/commitdiff
#2725: Fix missing local, and handle errors without tracebacks.
authorGeorg Brandl <georg@python.org>
Sun, 12 Apr 2009 11:34:13 +0000 (11:34 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 12 Apr 2009 11:34:13 +0000 (11:34 +0000)
Parser/asdl.py

index 418ac5717d2a8fd2609c32b3eebbf4592623f5aa..ce9d0d37f5e9e3ef2ceba676918b740e079d8e61 100644 (file)
@@ -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):