summaryrefslogtreecommitdiffstats
path: root/Lib/smtpd.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-04-06 18:22:39 (GMT)
committerGitHub <noreply@github.com>2022-04-06 18:22:39 (GMT)
commit32b33879c2e19cde735c1971b06869976200e1d8 (patch)
treeaca6fd7b428c949484b5b6a0bb0f858b411cc563 /Lib/smtpd.py
parent59a99ae277e7d9f47edd4a538c1239d39f10db0c (diff)
downloadcpython-32b33879c2e19cde735c1971b06869976200e1d8.zip
cpython-32b33879c2e19cde735c1971b06869976200e1d8.tar.gz
cpython-32b33879c2e19cde735c1971b06869976200e1d8.tar.bz2
bpo-47061: use `warnings._deprecated()` with asynchat, asyncore, and smtpd (GH-32350)
Diffstat (limited to 'Lib/smtpd.py')
-rwxr-xr-xLib/smtpd.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
index eeda155..b23579f 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -77,19 +77,18 @@ import getopt
import time
import socket
import collections
-from warnings import warn
+from warnings import _deprecated, warn
from email._header_value_parser import get_addr_spec, get_angle_addr
__all__ = [
"SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy",
]
-warn(
- 'The smtpd module is deprecated and unmaintained and will be removed '
- 'in Python 3.12. Please see aiosmtpd '
- '(https://aiosmtpd.readthedocs.io/) for the recommended replacement.',
- DeprecationWarning,
- stacklevel=2)
+_DEPRECATION_MSG = ('The {name} module is deprecated and unmaintained and will '
+ 'be removed in Python {remove}. Please see aiosmtpd '
+ '(https://aiosmtpd.readthedocs.io/) for the recommended '
+ 'replacement.')
+_deprecated(__name__, _DEPRECATION_MSG, remove=(3, 12))
# These are imported after the above warning so that users get the correct