[Python-checkins] Fix error messages in argparse examples (GH-6435)
Miss Islington (bot)
webhook-mailer at python.org
Wed Apr 11 14:58:13 EDT 2018
https://github.com/python/cpython/commit/cbbf7461862fd1fb497ed32d09b1328250fd85c9
commit: cbbf7461862fd1fb497ed32d09b1328250fd85c9
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-04-11T11:58:09-07:00
summary:
Fix error messages in argparse examples (GH-6435)
The examples in argparse documentation use `error: too few arguments`
error message which was removed in this commit f97c59a in 2011.
(cherry picked from commit 04e82934659487ecae76bf4a2db7f92c8dbe0d25)
Co-authored-by: suic86 <marko.gabriel.cz at gmail.com>
files:
M Doc/library/argparse.rst
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index cc99cce2b27d..3f327c0cfa77 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -712,7 +712,7 @@ be positional::
Namespace(bar='BAR', foo='FOO')
>>> parser.parse_args(['--foo', 'FOO'])
usage: PROG [-h] [-f FOO] bar
- PROG: error: too few arguments
+ PROG: error: the following arguments are required: bar
action
@@ -898,7 +898,7 @@ values are:
Namespace(foo=['a', 'b'])
>>> parser.parse_args([])
usage: PROG [-h] foo [foo ...]
- PROG: error: too few arguments
+ PROG: error: the following arguments are required: foo
.. _`argparse.REMAINDER`:
More information about the Python-checkins
mailing list