Skip to content

Commit 5f5c0b9

Browse files
GH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932)
1 parent 0e89f7a commit 5f5c0b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/argparse.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ The ``deprecated`` keyword argument of
14551455
specifies if the argument is deprecated and will be removed
14561456
in the future.
14571457
For arguments, if ``deprecated`` is ``True``, then a warning will be
1458-
printed to standard error when the argument is used::
1458+
printed to :data:`sys.stderr` when the argument is used::
14591459

14601460
>>> import argparse
14611461
>>> parser = argparse.ArgumentParser(prog='snake.py')
@@ -2235,8 +2235,8 @@ Exiting methods
22352235
.. method:: ArgumentParser.exit(status=0, message=None)
22362236

22372237
This method terminates the program, exiting with the specified *status*
2238-
and, if given, it prints a *message* before that. The user can override
2239-
this method to handle these steps differently::
2238+
and, if given, it prints a *message* to :data:`sys.stderr` before that.
2239+
The user can override this method to handle these steps differently::
22402240

22412241
class ErrorCatchingArgumentParser(argparse.ArgumentParser):
22422242
def exit(self, status=0, message=None):
@@ -2246,8 +2246,8 @@ Exiting methods
22462246

22472247
.. method:: ArgumentParser.error(message)
22482248

2249-
This method prints a usage message including the *message* to the
2250-
standard error and terminates the program with a status code of 2.
2249+
This method prints a usage message, including the *message*, to
2250+
:data:`sys.stderr` and terminates the program with a status code of 2.
22512251

22522252

22532253
Intermixed parsing

0 commit comments

Comments
 (0)