add parameter name in error message

This commit is contained in:
Daniel Schadt 2016-09-15 16:38:18 +02:00
parent b6d9d3f955
commit 794eb84805

View File

@ -247,9 +247,10 @@ class Command:
if self._inspect_special_param(param):
continue
if (param.kind == inspect.Parameter.KEYWORD_ONLY and
param.default is inspect.Parameter.empty):
param.default is inspect.Parameter.empty):
raise TypeError("{}: handler has keyword only argument "
"without default!".format(self.name))
"{!r} without default!".format(self.name,
param.name))
typ = self._get_type(param)
is_bool = typ is bool
kwargs = self._param_to_argparse_kwargs(param, is_bool)