Skip to content

Commit

Permalink
Note argparse exit code in documentation (GH-119568)
Browse files Browse the repository at this point in the history
Co-authored-by: Savannah Ostrowski <[email protected]>
  • Loading branch information
jkunimune and savannahostrowski authored Oct 10, 2024
1 parent c901437 commit 3b87fb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ exit_on_error
^^^^^^^^^^^^^

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

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

0 comments on commit 3b87fb7

Please sign in to comment.