summaryrefslogtreecommitdiffstats
path: root/Lib/argparse.py
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-09-06 13:49:15 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-09-06 13:49:15 (GMT)
commitcdac5516750e3b80b846e0e156e496dd92be9b56 (patch)
tree5530922f0e4a08e12d99f3a94443c71fc89c8d12 /Lib/argparse.py
parent309836c5c8a7bf85c666ff913bf903b8f735cfa5 (diff)
downloadcpython-cdac5516750e3b80b846e0e156e496dd92be9b56.zip
cpython-cdac5516750e3b80b846e0e156e496dd92be9b56.tar.gz
cpython-cdac5516750e3b80b846e0e156e496dd92be9b56.tar.bz2
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.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py
index 5ff755c..9520e0e 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):