mirror of
https://github.com/python/cpython.git
synced 2025-09-21 16:10:33 +00:00
#6647: document that catch_warnings is not thread-safe
This commit is contained in:
parent
f37592fda1
commit
d886290464
1 changed files with 8 additions and 0 deletions
|
@ -381,6 +381,14 @@ Available Context Managers
|
||||||
protected. This argument exists primarily for testing the :mod:`warnings`
|
protected. This argument exists primarily for testing the :mod:`warnings`
|
||||||
module itself.
|
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::
|
.. note::
|
||||||
|
|
||||||
In Python 3.0, the arguments to the constructor for
|
In Python 3.0, the arguments to the constructor for
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue