summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-04-12 00:02:19 (GMT)
committerGitHub <noreply@github.com>2022-04-12 00:02:19 (GMT)
commitf45aa8f304a12990c2ca687f2088f04b07906033 (patch)
treebea817bc4da59c5e7a195c23298ede51cc46a6ec /Lib
parent8a35ce3796e92f8a826955753920ca0567dbe343 (diff)
downloadcpython-f45aa8f304a12990c2ca687f2088f04b07906033.zip
cpython-f45aa8f304a12990c2ca687f2088f04b07906033.tar.gz
cpython-f45aa8f304a12990c2ca687f2088f04b07906033.tar.bz2
gh-91217: deprecate crypt (GH-91459)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/crypt.py4
-rw-r--r--Lib/test/test_crypt.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/Lib/crypt.py b/Lib/crypt.py
index 33dbc46..46c3de8 100644
--- a/Lib/crypt.py
+++ b/Lib/crypt.py
@@ -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()
diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py
index 877c575..b2a5ce6 100644
--- a/Lib/test/test_crypt.py
+++ b/Lib/test/test_crypt.py
@@ -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':