summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/mimetools.py6
-rw-r--r--Misc/NEWS4
2 files changed, 9 insertions, 1 deletions
diff --git a/Lib/mimetools.py b/Lib/mimetools.py
index 02963b5..097eda4 100644
--- a/Lib/mimetools.py
+++ b/Lib/mimetools.py
@@ -2,8 +2,12 @@
import os
-import rfc822
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
warnpy3k("in 3.x, mimetools has been removed in favor of the email package",
diff --git a/Misc/NEWS b/Misc/NEWS
index 0a66c78..586aa7c 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -48,6 +48,10 @@ Core and Builtins
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 #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to