mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #22389: Add contextlib.redirect_stderr().
This commit is contained in:
parent
ae553eb794
commit
bb44fe0a0b
5 changed files with 85 additions and 34 deletions
|
@ -172,6 +172,16 @@ Functions and classes provided:
|
|||
.. versionadded:: 3.4
|
||||
|
||||
|
||||
.. function:: redirect_stderr(new_target)
|
||||
|
||||
Similar to :func:`~contextlib.redirect_stdout` but redirecting
|
||||
:data:`sys.stderr` to another file or file-like object.
|
||||
|
||||
This context manager is :ref:`reentrant <reentrant-cms>`.
|
||||
|
||||
.. versionadded:: 3.5
|
||||
|
||||
|
||||
.. class:: ContextDecorator()
|
||||
|
||||
A base class that enables a context manager to also be used as a decorator.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue