From 5d81889a4ff7b8f2fad625084e323ec71cc24493 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 9 Apr 2010 22:05:44 +0200 Subject: [PATCH] The ``crypt`` module is only present on Unix, import if needed --- radicale/acl/htpasswd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radicale/acl/htpasswd.py b/radicale/acl/htpasswd.py index 08e0f0b..239dfa4 100644 --- a/radicale/acl/htpasswd.py +++ b/radicale/acl/htpasswd.py @@ -28,7 +28,6 @@ supported, but md5 is not (see ``htpasswd`` man page to understand why). """ import base64 -import crypt import hashlib from radicale import config @@ -45,6 +44,8 @@ def _plain(hash_value, password): def _crypt(hash_value, password): """Check if ``hash_value`` and ``password`` match using crypt method.""" + # The ``crypt`` module is only present on Unix, import if needed + import crypt return crypt.crypt(password, hash_value) == hash_value