Closes #20235: Report file and line on unexpected exceptions in Argument Clinic.

This commit is contained in:
Georg Brandl 2014-01-16 06:53:54 +01:00
parent bac7793b5b
commit aabebde358

View file

@ -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()