[Python-checkins] r79608 - python/trunk/Doc/library/warnings.rst

andrew.kuchling python-checkins at python.org
Fri Apr 2 19:54:26 CEST 2010


Author: andrew.kuchling
Date: Fri Apr  2 19:54:26 2010
New Revision: 79608

Log:
#6647: add note to two examples

Modified:
   python/trunk/Doc/library/warnings.rst

Modified: python/trunk/Doc/library/warnings.rst
==============================================================================
--- python/trunk/Doc/library/warnings.rst	(original)
+++ python/trunk/Doc/library/warnings.rst	Fri Apr  2 19:54:26 2010
@@ -173,7 +173,10 @@
 While within the context manager all warnings will simply be ignored. This
 allows you to use known-deprecated code without having to see the warning while
 not suppressing the warning for other code that might not be aware of its use
-of deprecated code.
+of deprecated code.  Note: this can only be guaranteed in a single-threaded
+application. If two or more threads use the :class:`catch_warnings` context
+manager at the same time, the behavior is undefined.
+
 
 
 .. _warning-testing:
@@ -211,7 +214,9 @@
 when the context was entered. This prevents tests from changing the warnings
 filter in unexpected ways between tests and leading to indeterminate test
 results. The :func:`showwarning` function in the module is also restored to
-its original value.
+its original value.  Note: this can only be guaranteed in a single-threaded
+application. If two or more threads use the :class:`catch_warnings` context
+manager at the same time, the behavior is undefined.
 
 When testing multiple operations that raise the same kind of warning, it
 is important to test them in a manner that confirms each operation is raising


More information about the Python-checkins mailing list