Commit f4e725f2 authored by shireenrao's avatar shireenrao Committed by Paul Moore

bpo-25172: Raise appropriate ImportError msg when crypt module used on Windows (GH-15149)

parent 2a570af1
"""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
......
Trying to import the :mod:`crypt` module on Windows will result in an :exc:`ImportError` with a message explaining that the module isn't supported on Windows. On other platforms, if the underlying ``_crypt`` module is not available, the ImportError will include a message explaining the problem.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment