summaryrefslogtreecommitdiffstats
path: root/Lib/asynchat.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/asynchat.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/asynchat.py')
-rw-r--r--Lib/asynchat.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
index e081e67..bed797e 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -48,12 +48,11 @@ you - by calling your self.found_terminator() method.
import asyncore
from collections import deque
-from warnings import warn
-warn(
- 'The asynchat module is deprecated and will be removed in Python 3.12. '
- 'The recommended replacement is asyncio',
- DeprecationWarning,
- stacklevel=2)
+from warnings import _deprecated
+
+_DEPRECATION_MSG = ('The {name} module is deprecated and will be removed in '
+ 'Python {remove}. The recommended replacement is asyncio')
+_deprecated(__name__, _DEPRECATION_MSG, remove=(3, 12))