From c249bdab92cc6fd933fb4972356a3fb0a0865ec4 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 30 May 2007 21:48:58 +0000 Subject: [PATCH] Have mimify raise a DeprecationWarning. The docs and PEP 4 have listed the module as deprecated for a while. --- Lib/mimify.py | 4 ++++ Lib/test/test___all__.py | 2 ++ Lib/test/test_sundry.py | 1 + Misc/NEWS | 2 ++ 4 files changed, 9 insertions(+) diff --git a/Lib/mimify.py b/Lib/mimify.py index b6f61439d75..1c15983d1e2 100755 --- a/Lib/mimify.py +++ b/Lib/mimify.py @@ -29,6 +29,10 @@ QUOTE = '> ' # string replies are quoted with import re +import warnings +warnings.warn("the mimify module is deprecated; use the email package instead", + DeprecationWarning, 2) + __all__ = ["mimify","unmimify","mime_encode_header","mime_decode_header"] qp = re.compile('^content-transfer-encoding:\\s*quoted-printable', re.I) diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 071ed04251f..26ed012272b 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -9,6 +9,8 @@ warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*", DeprecationWarning) warnings.filterwarnings("ignore", "the MimeWriter module is deprecated.*", DeprecationWarning) +warnings.filterwarnings("ignore", "the mimify module is deprecated.*", + DeprecationWarning) class AllTest(unittest.TestCase): diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py index 5711fb216eb..533aedc5df6 100644 --- a/Lib/test/test_sundry.py +++ b/Lib/test/test_sundry.py @@ -6,6 +6,7 @@ import warnings with guard_warnings_filter(): warnings.filterwarnings('ignore', r".*posixfile", DeprecationWarning) + warnings.filterwarnings('ignore', r".*mimify", DeprecationWarning) from test.test_support import verbose diff --git a/Misc/NEWS b/Misc/NEWS index 4ca7fa8da2a..8f4bcebb8c4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -220,6 +220,8 @@ Core and builtins Library ------- +- mimify now raises a DeprecationWarning upon import. + - MimeWriter now raises a DeprecationWarning upon import. - tarfile.py: Improved unicode support. Unicode input names are now