Skip to content

Commit eb320f5

Browse files
miss-islingtonjkunimunesavannahostrowski
authored
[3.12] Note argparse exit code in documentation (GH-119568) (GH-125275)
(cherry picked from commit 3b87fb7) Co-authored-by: Justin Kunimune <[email protected]> Co-authored-by: Savannah Ostrowski <[email protected]>
1 parent ba292cc commit eb320f5

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
@@ -537,7 +537,8 @@ exit_on_error
537537
^^^^^^^^^^^^^
538538

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

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

0 commit comments

Comments
 (0)