Skip to content

Commit

Permalink
gh-91217: deprecate crypt (GH-91459)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon authored Apr 12, 2022
1 parent 8a35ce3 commit f45aa8f
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 @@ -851,6 +851,7 @@ Deprecated
* :mod:`cgi`
* :mod:`cgitb`
* :mod:`chunk`
* :mod:`crypt`

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

Expand Down
4 changes: 4 additions & 0 deletions Lib/crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@

import errno
import string as _string
import warnings
from random import SystemRandom as _SystemRandom
from collections import namedtuple as _namedtuple


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


_saltchars = _string.ascii_letters + _string.digits + './'
_sr = _SystemRandom()

Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_crypt.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import sys
import unittest
from test.support import check_sanitizer
from test.support import check_sanitizer, warnings_helper


try:
if check_sanitizer(address=True, memory=True):
raise unittest.SkipTest("The crypt module SEGFAULTs on ASAN/MSAN builds")
import crypt
crypt = warnings_helper.import_deprecated("crypt")
IMPORT_ERROR = None
except ImportError as ex:
if sys.platform != 'win32':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate the crypt module.

0 comments on commit f45aa8f

Please sign in to comment.