Kaydet (Commit) bf3157b8 authored tarafından Brett Cannon's avatar Brett Cannon

Silence the DeprecationWarning of rfc822 triggered by its importation in

mimetools.

This has an unfortunate side-effect of potentially not letting any warning
about rfc822's deprecation be seen by user-visible code if rfc822 is not
imported before mimetools. This is because modules are cached in sys.modules
and thus do not have their deprecation triggered more than once. But this
silencing would have happened by other code that silences the use of mimetools
or rfc822 anyway in the stdlib or user code, and thus seems justified to be
done here.
üst eea8eda3
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
import os import os
import rfc822
import tempfile import tempfile
from test.test_support import catch_warning
from warnings import filterwarnings
with catch_warning(record=False):
filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)
import rfc822
from warnings import warnpy3k from warnings import warnpy3k
warnpy3k("in 3.x, mimetools has been removed in favor of the email package", warnpy3k("in 3.x, mimetools has been removed in favor of the email package",
......
...@@ -48,6 +48,10 @@ Core and Builtins ...@@ -48,6 +48,10 @@ Core and Builtins
Library Library
------- -------
- Silence the DeprecationWarning of rfc822 when it is imported by mimetools
since mimetools itself is deprecated. Because modules are cached, all
subsequent imports of rfc822 will not raise a visible DeprecationWarning.
- Issue #3134: shutil referenced undefined WindowsError symbol. - Issue #3134: shutil referenced undefined WindowsError symbol.
- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to - Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment