mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-25172: Raise appropriate ImportError msg when crypt module used on Windows (GH-15149)
This commit is contained in:
parent
2a570af12a
commit
f4e725f224
2 changed files with 11 additions and 1 deletions
11
Lib/crypt.py
11
Lib/crypt.py
|
@ -1,6 +1,15 @@
|
|||
"""Wrapper to the POSIX crypt library call and associated functionality."""
|
||||
|
||||
import _crypt
|
||||
import sys as _sys
|
||||
|
||||
try:
|
||||
import _crypt
|
||||
except ModuleNotFoundError:
|
||||
if _sys.platform == 'win32':
|
||||
raise ImportError("The crypt module is not supported on Windows")
|
||||
else:
|
||||
raise ImportError("The required _crypt module was not built as part of CPython")
|
||||
|
||||
import string as _string
|
||||
from random import SystemRandom as _SystemRandom
|
||||
from collections import namedtuple as _namedtuple
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue