Skip to content

Commit 8b9606a

Browse files
authored
gh-139452: Clarify redirect_stdout, stderr behavior (gh-139490)
1 parent 3d3f126 commit 8b9606a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/library/contextlib.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ Functions and classes provided:
327327
.. function:: redirect_stdout(new_target)
328328

329329
Context manager for temporarily redirecting :data:`sys.stdout` to
330-
another file or file-like object.
330+
another :term:`file object`.
331331

332332
This tool adds flexibility to existing functions or classes whose output
333-
is hardwired to stdout.
333+
is hardwired to :data:`sys.stdout`.
334334

335335
For example, the output of :func:`help` normally is sent to *sys.stdout*.
336336
You can capture that output in a string by redirecting the output to an
@@ -366,8 +366,8 @@ Functions and classes provided:
366366

367367
.. function:: redirect_stderr(new_target)
368368

369-
Similar to :func:`~contextlib.redirect_stdout` but redirecting
370-
:data:`sys.stderr` to another file or file-like object.
369+
Similar to :func:`~contextlib.redirect_stdout` but redirecting the global
370+
:data:`sys.stderr` to another :term:`file object`.
371371

372372
This context manager is :ref:`reentrant <reentrant-cms>`.
373373

0 commit comments

Comments
 (0)