[3.13] Note argparse exit code in documentation (GH-119568) (GH-125274)

(cherry picked from commit 3b87fb74c9)

Co-authored-by: Justin Kunimune <justinkunimune@gmail.com>
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-10-10 20:18:17 +02:00 committed by GitHub
parent 2f87976926
commit 319305c0bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -537,7 +537,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``::