The argument to type can be any callable that accepts a single string. If the function raises ArgumentTypeError, TypeError, or ValueError, the exception is caught and a nicely formatted error message is displayed. No other exception types are handled.
This changes check_file to raise ArgumentTypeError so that the error gets reported correctly.
check_file
is used as anargparse
type, and as mentioned by theargparse
docs:https://docs.python.org/3/library/argparse.html#type
This changes
check_file
to raiseArgumentTypeError
so that the error gets reported correctly.PR extracted from #197 and authored by @eggplants