Skip to content

Commit f45aa8f

Browse files
authored
gh-91217: deprecate crypt (GH-91459)
1 parent 8a35ce3 commit f45aa8f

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ Deprecated
851851
* :mod:`cgi`
852852
* :mod:`cgitb`
853853
* :mod:`chunk`
854+
* :mod:`crypt`
854855

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

Lib/crypt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212

1313
import errno
1414
import string as _string
15+
import warnings
1516
from random import SystemRandom as _SystemRandom
1617
from collections import namedtuple as _namedtuple
1718

1819

20+
warnings._deprecated(__name__, remove=(3, 13))
21+
22+
1923
_saltchars = _string.ascii_letters + _string.digits + './'
2024
_sr = _SystemRandom()
2125

Lib/test/test_crypt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import sys
22
import unittest
3-
from test.support import check_sanitizer
3+
from test.support import check_sanitizer, warnings_helper
44

55

66
try:
77
if check_sanitizer(address=True, memory=True):
88
raise unittest.SkipTest("The crypt module SEGFAULTs on ASAN/MSAN builds")
9-
import crypt
9+
crypt = warnings_helper.import_deprecated("crypt")
1010
IMPORT_ERROR = None
1111
except ImportError as ex:
1212
if sys.platform != 'win32':
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate the crypt module.

0 commit comments

Comments
 (0)