summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-05-30 20:46:26 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-05-30 20:46:26 (GMT)
commit90134c9a05146f3cc53fcb8a5de8fdfc2fe8dc93 (patch)
tree5db4301e47fae7b88d59f4068af7be6aabadd004
parentb4eec28e3386c52a43cc02737517759deb3a3df5 (diff)
downloadcpython-90134c9a05146f3cc53fcb8a5de8fdfc2fe8dc93.zip
cpython-90134c9a05146f3cc53fcb8a5de8fdfc2fe8dc93.tar.gz
cpython-90134c9a05146f3cc53fcb8a5de8fdfc2fe8dc93.tar.bz2
Have MimeWriter raise a DeprecationWarning as per PEP 4 and its documentation.
-rw-r--r--Lib/MimeWriter.py5
-rw-r--r--Lib/test/test_MimeWriter.py4
-rw-r--r--Lib/test/test___all__.py2
-rw-r--r--Misc/NEWS2
4 files changed, 13 insertions, 0 deletions
diff --git a/Lib/MimeWriter.py b/Lib/MimeWriter.py
index 58c0a0b..e898f9f 100644
--- a/Lib/MimeWriter.py
+++ b/Lib/MimeWriter.py
@@ -14,6 +14,11 @@ import mimetools
__all__ = ["MimeWriter"]
+import warnings
+
+warnings.warn("the MimeWriter module is deprecated; use the email package instead",
+ DeprecationWarning, 2)
+
class MimeWriter:
"""Generic MIME writer.
diff --git a/Lib/test/test_MimeWriter.py b/Lib/test/test_MimeWriter.py
index feca163..5a20bf2 100644
--- a/Lib/test/test_MimeWriter.py
+++ b/Lib/test/test_MimeWriter.py
@@ -10,6 +10,10 @@ This should generate Barry's example, modulo some quotes and newlines.
import unittest, sys, StringIO
from test.test_support import run_unittest
+import warnings
+warnings.filterwarnings("ignore", "the MimeWriter module is deprecated.*",
+ DeprecationWarning)
+
from MimeWriter import MimeWriter
SELLER = '''\
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 14795a6..071ed04 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -7,6 +7,8 @@ warnings.filterwarnings("ignore", "the sets module is deprecated",
DeprecationWarning, "<string>")
warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*",
DeprecationWarning)
+warnings.filterwarnings("ignore", "the MimeWriter module is deprecated.*",
+ DeprecationWarning)
class AllTest(unittest.TestCase):
diff --git a/Misc/NEWS b/Misc/NEWS
index 1ce32ce..4ca7fa8 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -220,6 +220,8 @@ Core and builtins
Library
-------
+- MimeWriter now raises a DeprecationWarning upon import.
+
- tarfile.py: Improved unicode support. Unicode input names are now
officially supported. Added "errors" argument to the TarFile class.