summaryrefslogtreecommitdiffstats
path: root/Doc/library/contextlib.rst
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-11-28 21:28:06 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2014-11-28 21:28:06 (GMT)
commitbb44fe0a0bf0b1688f95b3cce34a69d98a58e371 (patch)
treea1cabb3c2abb956203dec777af9091394e47317a /Doc/library/contextlib.rst
parentae553eb794cae10de0ece64de096647a8b304137 (diff)
downloadcpython-bb44fe0a0bf0b1688f95b3cce34a69d98a58e371.zip
cpython-bb44fe0a0bf0b1688f95b3cce34a69d98a58e371.tar.gz
cpython-bb44fe0a0bf0b1688f95b3cce34a69d98a58e371.tar.bz2
Issue #22389: Add contextlib.redirect_stderr().
Diffstat (limited to 'Doc/library/contextlib.rst')
-rw-r--r--Doc/library/contextlib.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index 6f36864..550b347 100644
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -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.