Skip to content

Commit

Permalink
gh-91217: deprecate telnetlib (GH-91958)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon authored Apr 26, 2022
1 parent 4153f2c commit 1af871e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ Deprecated
* :mod:`sndhdr`
* :mod:`spwd`
* :mod:`sunau`
* :mod:`telnetlib`

(Contributed by Brett Cannon in :issue:`47061`.)

Expand Down
3 changes: 3 additions & 0 deletions Lib/telnetlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
import socket
import selectors
from time import monotonic as _time
import warnings

warnings._deprecated(__name__, remove=(3, 13))

__all__ = ["Telnet"]

Expand Down
5 changes: 3 additions & 2 deletions Lib/test/test_telnetlib.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate the telnetlib module.

0 comments on commit 1af871e

Please sign in to comment.