From: Georg Brandl Date: Thu, 16 Jan 2014 05:53:54 +0000 (+0100) Subject: Closes #20235: Report file and line on unexpected exceptions in Argument Clinic. X-Git-Tag: v3.4.0b3~134 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aabebde358a9a9630e7afb03b4bc4bd217774ef3;p=python Closes #20235: Report file and line on unexpected exceptions in Argument Clinic. --- diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index ed59f05b1e..23e0b93933 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -21,6 +21,7 @@ import shlex import sys import tempfile import textwrap +import traceback # TODO: # @@ -1082,7 +1083,11 @@ class Clinic: assert dsl_name in parsers, "No parser to handle {!r} block.".format(dsl_name) self.parsers[dsl_name] = parsers[dsl_name](self) parser = self.parsers[dsl_name] - parser.parse(block) + try: + parser.parse(block) + except Exception: + fail('Exception raised during parsing:\n' + + traceback.format_exc().rstrip()) printer.print_block(block) return printer.f.getvalue()