Skip to content

Crash when using action='store_true' #5

@Radagaisus

Description

@Radagaisus

Using parser.add_argument('--spectate', default=False, action='store_true') crashes with the following error:

Traceback (most recent call last):
...
  File "/opt/anaconda3/lib/python3.7/site-packages/argparse_prompt.py", line 30, in add_argument
    action = super().add_argument(*args, type=type, default='', **kwargs)
  File "/opt/anaconda3/lib/python3.7/argparse.py", line 1353, in add_argument
    action = action_class(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'type'

Problem is here. Passing a type when it’s not needed will cause Argparse to throw the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions