Skip to content

Commit e98e338

Browse files
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 04e8293) Co-authored-by: suic86 <[email protected]>
1 parent 910d71b commit e98e338

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/argparse.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ be positional::
712712
Namespace(bar='BAR', foo='FOO')
713713
>>> parser.parse_args(['--foo', 'FOO'])
714714
usage: PROG [-h] [-f FOO] bar
715-
PROG: error: too few arguments
715+
PROG: error: the following arguments are required: bar
716716

717717

718718
action
@@ -898,7 +898,7 @@ values are:
898898
Namespace(foo=['a', 'b'])
899899
>>> parser.parse_args([])
900900
usage: PROG [-h] foo [foo ...]
901-
PROG: error: too few arguments
901+
PROG: error: the following arguments are required: foo
902902

903903
.. _`argparse.REMAINDER`:
904904

0 commit comments

Comments
 (0)