diff options
author | Victor Stinner <vstinner@python.org> | 2022-04-26 20:43:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 20:43:50 (GMT) |
commit | 80de0273c0caf8bae19787bb00255eb3fb2a2d0c (patch) | |
tree | eae25b99f66f046643c7990716ee7bd1b1c8ff2c /Lib | |
parent | b87f7f2c213225cbe5c4bd8f8a83883e0824c7d0 (diff) | |
download | cpython-80de0273c0caf8bae19787bb00255eb3fb2a2d0c.zip cpython-80de0273c0caf8bae19787bb00255eb3fb2a2d0c.tar.gz cpython-80de0273c0caf8bae19787bb00255eb3fb2a2d0c.tar.bz2 |
gh-68966: Deprecate the mailcap module (#91951)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/mailcap.py | 6 | ||||
-rw-r--r-- | Lib/test/test_mailcap.py | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/Lib/mailcap.py b/Lib/mailcap.py index ae416a8..856b6a5 100644 --- a/Lib/mailcap.py +++ b/Lib/mailcap.py @@ -6,6 +6,12 @@ import warnings __all__ = ["getcaps","findmatch"] +_DEPRECATION_MSG = ('The {name} module is deprecated and will be removed in ' + 'Python {remove}. See the mimetypes module for an ' + 'alternative.') +warnings._deprecated(__name__, _DEPRECATION_MSG, remove=(3, 13)) + + def lineno_sort_key(entry): # Sort in ascending order, with unspecified entries at the end if 'lineno' in entry: diff --git a/Lib/test/test_mailcap.py b/Lib/test/test_mailcap.py index ef9cad4..97a8fac 100644 --- a/Lib/test/test_mailcap.py +++ b/Lib/test/test_mailcap.py @@ -1,10 +1,15 @@ -import mailcap -import os import copy +import os +import sys import test.support -from test.support import os_helper import unittest -import sys +import warnings +from test.support import os_helper +from test.support import warnings_helper + + +mailcap = warnings_helper.import_deprecated('mailcap') + # Location of mailcap file MAILCAPFILE = test.support.findfile("mailcap.txt") |