Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion 11 Lib/crypt.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.