From d8862904641efabcded42a8db16f255f171e59e7 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Fri, 2 Apr 2010 17:48:23 +0000 Subject: #6647: document that catch_warnings is not thread-safe --- Doc/library/warnings.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index e4343e8..91ab085 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -383,6 +383,14 @@ Available Context Managers .. 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 :class:`catch_warnings` are keyword-only arguments. -- cgit v0.12