@@ -678,19 +678,16 @@ def _complete_for_arg(self, action: argparse.Action,
678678 list_args = arg_choices [index ]
679679 elif isinstance (arg_choices [index ], dict ):
680680 kw_args = arg_choices [index ]
681- try :
682- # call the provided function differently depending on the provided positional and keyword arguments
683- if list_args is not None and kw_args is not None :
684- return completer (text , line , begidx , endidx , * list_args , ** kw_args )
685- elif list_args is not None :
686- return completer (text , line , begidx , endidx , * list_args )
687- elif kw_args is not None :
688- return completer (text , line , begidx , endidx , ** kw_args )
689- else :
690- return completer (text , line , begidx , endidx )
691- except TypeError :
692- # assume this is due to an incorrect function signature, return nothing.
693- return []
681+
682+ # call the provided function differently depending on the provided positional and keyword arguments
683+ if list_args is not None and kw_args is not None :
684+ return completer (text , line , begidx , endidx , * list_args , ** kw_args )
685+ elif list_args is not None :
686+ return completer (text , line , begidx , endidx , * list_args )
687+ elif kw_args is not None :
688+ return completer (text , line , begidx , endidx , ** kw_args )
689+ else :
690+ return completer (text , line , begidx , endidx )
694691 else :
695692 return self ._cmd2_app .basic_complete (text , line , begidx , endidx ,
696693 self ._resolve_choices_for_arg (action , used_values ))
0 commit comments