From: Andrew M. Kuchling Date: Fri, 2 Apr 2010 17:48:23 +0000 (+0000) Subject: #6647: document that catch_warnings is not thread-safe X-Git-Tag: v2.7b1~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8862904641efabcded42a8db16f255f171e59e7;p=thirdparty%2FPython%2Fcpython.git #6647: document that catch_warnings is not thread-safe --- diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index e4343e87fad0..91ab0854b57a 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -381,6 +381,14 @@ Available Context Managers protected. This argument exists primarily for testing the :mod:`warnings` module itself. + .. note:: + + The :class:`catch_warnings` manager works by replacing and + then later restoring the module's + :func:`showwarning` function and internal list of filter + specifications. This means the context manager is modifying + global state and therefore is not thread-safe. + .. note:: In Python 3.0, the arguments to the constructor for