summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-04-26 17:45:08 (GMT)
committerGitHub <noreply@github.com>2022-04-26 17:45:08 (GMT)
commit1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d (patch)
treed3f628ac343850c66c60a5c6a0cc92e059f7dc0c /Lib
parent4153f2cbcb41a1a9057bfba28d5f65d48ea39283 (diff)
downloadcpython-1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d.zip
cpython-1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d.tar.gz
cpython-1af871eeee4a01cc21a6960d087e9ab8ce4c9f4d.tar.bz2
gh-91217: deprecate telnetlib (GH-91958)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/telnetlib.py3
-rw-r--r--Lib/test/test_telnetlib.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py
index ae88ea5..62d6361 100644
--- a/Lib/telnetlib.py
+++ b/Lib/telnetlib.py
@@ -37,6 +37,9 @@ import sys
import socket
import selectors
from time import monotonic as _time
+import warnings
+
+warnings._deprecated(__name__, remove=(3, 13))
__all__ = ["Telnet"]
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index b50df14..a9cade2 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -1,15 +1,16 @@
import socket
import selectors
-import telnetlib
import threading
import contextlib
from test import support
-from test.support import socket_helper
+from test.support import socket_helper, warnings_helper
import unittest
support.requires_working_socket(module=True)
+telnetlib = warnings_helper.import_deprecated('telnetlib')
+
HOST = socket_helper.HOST
def server(evt, serv):