[issue39333] argparse should offer an alternative to SystemExit in case a parse fails

2020-01-14 Thread Jack Orenstein
Jack Orenstein added the comment: Yes! I didn't know about that method, thank you. -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39333] argparse should offer an alternative to SystemExit in case a parse fails

2020-01-14 Thread Eric V. Smith
Eric V. Smith added the comment: Maybe argparse could raise an exception derived from SystemExit, then you could catch that. -- nosy: +eric.smith ___ Python tracker ___ _

[issue39333] argparse should offer an alternative to SystemExit in case a parse fails

2020-01-14 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Does overriding exit help here? https://docs.python.org/3.8/library/argparse.html#argparse.ArgumentParser.exit -- nosy: +paul.j3, xtreak ___ Python tracker __

[issue39333] argparse should offer an alternative to SystemExit in case a parse fails

2020-01-14 Thread Zachary Ware
Change by Zachary Ware : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue39333] argparse should offer an alternative to SystemExit in case a parse fails

2020-01-14 Thread Jack Orenstein
New submission from Jack Orenstein : If parse_args fails, SystemExit is raised, carrying an exit code of 2, and the help message is printed. For an embedded usage of argparse, this behavior is undesirable. I am writing an interactive console application, using argparse to parse input. When a