]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.8] Fix error in argparse documentation example (GH-17399) (GH-21990)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 4 Sep 2020 22:26:21 +0000 (15:26 -0700)
committerGitHub <noreply@github.com>
Fri, 4 Sep 2020 22:26:21 +0000 (15:26 -0700)
Automerge-Triggered-By: @rhettinger
(cherry picked from commit 8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c)

Co-authored-by: SarahPythonista <4283226+SarahPythonista@users.noreply.github.com>
Doc/library/argparse.rst

index e1b28e32ed1858deb231d8bcd68a6f9599be5fcc..2ec7ea3ecb4e3c909d2252f215c451fa0c189863 100644 (file)
@@ -1123,8 +1123,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