diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-09-06 06:49:15 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-09-06 06:49:15 -0700 |
commit | cdac5516750e3b80b846e0e156e496dd92be9b56 (patch) | |
tree | 5530922f0e4a08e12d99f3a94443c71fc89c8d12 /Lib/argparse.py | |
parent | 309836c5c8a7bf85c666ff913bf903b8f735cfa5 (diff) | |
download | cpython-cdac5516750e3b80b846e0e156e496dd92be9b56.tar.gz cpython-cdac5516750e3b80b846e0e156e496dd92be9b56.zip |
Issue #18920: argparse's default version action (for -v, --version) should
output to stdout, matching the 'python -v'
Reported by Wolfgang Maier
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index 5ff755c84ab..9520e0ea7c6 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1037,7 +1037,8 @@ class _VersionAction(Action): version = parser.version formatter = parser._get_formatter() formatter.add_text(version) - parser.exit(message=formatter.format_help()) + parser._print_message(formatter.format_help(), _sys.stdout) + parser.exit() class _SubParsersAction(Action): |