]> granicus.if.org Git - python/commitdiff
#6647: document that catch_warnings is not thread-safe
authorAndrew M. Kuchling <amk@amk.ca>
Fri, 2 Apr 2010 17:48:23 +0000 (17:48 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Fri, 2 Apr 2010 17:48:23 +0000 (17:48 +0000)
Doc/library/warnings.rst

index e4343e87fad01c1ce45bb028095114dd54a34992..91ab0854b57a94f2b197b5803318d5f0ab6cae84 100644 (file)
@@ -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