[Python-checkins] Fix error in argparse documentation example (GH-17399)

SarahPythonista webhook-mailer at python.org
Fri Aug 28 14:48:21 EDT 2020


https://github.com/python/cpython/commit/8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c
commit: 8784d3300ec4ffc58bc0e9ab3cff9a24187dbe4c
branch: master
author: SarahPythonista <4283226+SarahPythonista at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-08-28T11:47:58-07:00
summary:

Fix error in argparse documentation example (GH-17399)



Automerge-Triggered-By: @rhettinger

files:
M Doc/library/argparse.rst

diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 0b64dfe47f768..7a7a4cf94979a 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



More information about the Python-checkins mailing list