mirror of https://github.com/python/cpython
Have MimeWriter raise a DeprecationWarning as per PEP 4 and its documentation.
This commit is contained in:
parent
b4eec28e33
commit
90134c9a05
|
@ -14,6 +14,11 @@ import mimetools
|
||||||
|
|
||||||
__all__ = ["MimeWriter"]
|
__all__ = ["MimeWriter"]
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
warnings.warn("the MimeWriter module is deprecated; use the email package instead",
|
||||||
|
DeprecationWarning, 2)
|
||||||
|
|
||||||
class MimeWriter:
|
class MimeWriter:
|
||||||
|
|
||||||
"""Generic MIME writer.
|
"""Generic MIME writer.
|
||||||
|
|
|
@ -10,6 +10,10 @@ This should generate Barry's example, modulo some quotes and newlines.
|
||||||
import unittest, sys, StringIO
|
import unittest, sys, StringIO
|
||||||
from test.test_support import run_unittest
|
from test.test_support import run_unittest
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
warnings.filterwarnings("ignore", "the MimeWriter module is deprecated.*",
|
||||||
|
DeprecationWarning)
|
||||||
|
|
||||||
from MimeWriter import MimeWriter
|
from MimeWriter import MimeWriter
|
||||||
|
|
||||||
SELLER = '''\
|
SELLER = '''\
|
||||||
|
|
|
@ -7,6 +7,8 @@ warnings.filterwarnings("ignore", "the sets module is deprecated",
|
||||||
DeprecationWarning, "<string>")
|
DeprecationWarning, "<string>")
|
||||||
warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*",
|
warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*",
|
||||||
DeprecationWarning)
|
DeprecationWarning)
|
||||||
|
warnings.filterwarnings("ignore", "the MimeWriter module is deprecated.*",
|
||||||
|
DeprecationWarning)
|
||||||
|
|
||||||
class AllTest(unittest.TestCase):
|
class AllTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -220,6 +220,8 @@ Core and builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- MimeWriter now raises a DeprecationWarning upon import.
|
||||||
|
|
||||||
- tarfile.py: Improved unicode support. Unicode input names are now
|
- tarfile.py: Improved unicode support. Unicode input names are now
|
||||||
officially supported. Added "errors" argument to the TarFile class.
|
officially supported. Added "errors" argument to the TarFile class.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue