[Python-checkins] r55686 - in python/trunk: Lib/MimeWriter.py Lib/test/test_MimeWriter.py Lib/test/test___all__.py Misc/NEWS

brett.cannon python-checkins at python.org
Wed May 30 22:46:28 CEST 2007


Author: brett.cannon
Date: Wed May 30 22:46:26 2007
New Revision: 55686

Modified:
   python/trunk/Lib/MimeWriter.py
   python/trunk/Lib/test/test_MimeWriter.py
   python/trunk/Lib/test/test___all__.py
   python/trunk/Misc/NEWS
Log:
Have MimeWriter raise a DeprecationWarning as per PEP 4 and its documentation.


Modified: python/trunk/Lib/MimeWriter.py
==============================================================================
--- python/trunk/Lib/MimeWriter.py	(original)
+++ python/trunk/Lib/MimeWriter.py	Wed May 30 22:46:26 2007
@@ -14,6 +14,11 @@
 
 __all__ = ["MimeWriter"]
 
+import warnings
+
+warnings.warn("the MimeWriter module is deprecated; use the email package instead",
+                DeprecationWarning, 2)
+
 class MimeWriter:
 
     """Generic MIME writer.

Modified: python/trunk/Lib/test/test_MimeWriter.py
==============================================================================
--- python/trunk/Lib/test/test_MimeWriter.py	(original)
+++ python/trunk/Lib/test/test_MimeWriter.py	Wed May 30 22:46:26 2007
@@ -10,6 +10,10 @@
 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 = '''\

Modified: python/trunk/Lib/test/test___all__.py
==============================================================================
--- python/trunk/Lib/test/test___all__.py	(original)
+++ python/trunk/Lib/test/test___all__.py	Wed May 30 22:46:26 2007
@@ -7,6 +7,8 @@
                         DeprecationWarning, "<string>")
 warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*",
                         DeprecationWarning)
+warnings.filterwarnings("ignore", "the MimeWriter module is deprecated.*",
+                        DeprecationWarning)
 
 class AllTest(unittest.TestCase):
 

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Wed May 30 22:46:26 2007
@@ -220,6 +220,8 @@
 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.
 


More information about the Python-checkins mailing list