Closed davistardif closed 4 years ago
Please add test codes when PR. This modification causes a bug again.
AttributeError: 'NoneType' object has no attribute 'nargs'
((isinstance(action, argparse._StoreAction) or isinstance(action, argparse._AppendAction)) and
action.nargs is not None and
(action.nargs in ('+', '*')) or
(isinstance(action.nargs, int) and action.nargs > 1)) # Here is evaluated even if action is None
I am stupid and didn't actually fix the behavior for combining append and nargs in #178
I intended to allow actions of type append to accept lists when used with nargs=+,* or an int > 1 but I forgot to include the check that the action is append.
I also introduced a bug in #178 by not checking for nargs=None, which I apologize for, and am glad to see it was fixed quickly. This time I handle None correctly.