summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-09-04 22:26:22 (GMT)
committerGitHub <noreply@github.com>2020-09-04 22:26:22 (GMT)
commit78ef1b6b124bb89883f3b755ea4aeec480e0e21d (patch)
treecb4918f28457c458b753121ab6f553a38917f89b
parent672d8b9190ae9a9acd6a46b3c5559334884fb31c (diff)
downloadcpython-78ef1b6b124bb89883f3b755ea4aeec480e0e21d.zip
cpython-78ef1b6b124bb89883f3b755ea4aeec480e0e21d.tar.gz
cpython-78ef1b6b124bb89883f3b755ea4aeec480e0e21d.tar.bz2
[3.9] Fix error in argparse documentation example (GH-17399) (GH-21992)
Automerge-Triggered-By: @rhettinger (cherry picked from commit 8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c) Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
-rw-r--r--Doc/library/argparse.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 0b64dfe..7a7a4cf 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1162,8 +1162,8 @@ keyword argument to :meth:`~ArgumentParser.add_argument`::
>>> parser.parse_args(['--foo', 'BAR'])
Namespace(foo='BAR')
>>> parser.parse_args([])
- usage: argparse.py [-h] [--foo FOO]
- argparse.py: error: option --foo is required
+ usage: [-h] --foo FOO
+ : error: the following arguments are required: --foo
As the example shows, if an option is marked as ``required``,
:meth:`~ArgumentParser.parse_args` will report an error if that option is not