gh-91217: deprecate crypt (GH-91459)

This commit is contained in:
Brett Cannon 2022-04-11 17:02:19 -07:00 committed by GitHub
parent 8a35ce3796
commit f45aa8f304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -851,6 +851,7 @@ Deprecated
* :mod:`cgi`
* :mod:`cgitb`
* :mod:`chunk`
* :mod:`crypt`
(Contributed by Brett Cannon in :issue:`47061`.)

View File

@ -12,10 +12,14 @@ except ModuleNotFoundError:
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()

View File

@ -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':

View File

@ -0,0 +1 @@
Deprecate the crypt module.