Skip to content

Commit 3b87fb7

Browse files
Note argparse exit code in documentation (GH-119568)
Co-authored-by: Savannah Ostrowski <[email protected]>
1 parent c901437 commit 3b87fb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/library/argparse.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ exit_on_error
541541
^^^^^^^^^^^^^
542542

543543
Normally, when you pass an invalid argument list to the :meth:`~ArgumentParser.parse_args`
544-
method of an :class:`ArgumentParser`, it will exit with error info.
544+
method of an :class:`ArgumentParser`, it will print a *message* to :data:`sys.stderr` and exit with a status
545+
code of 2.
545546

546547
If the user would like to catch errors manually, the feature can be enabled by setting
547548
``exit_on_error`` to ``False``::

0 commit comments

Comments
 (0)