diff options
Diffstat (limited to 'passlib/handlers/md5_crypt.py')
-rw-r--r-- | passlib/handlers/md5_crypt.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/passlib/handlers/md5_crypt.py b/passlib/handlers/md5_crypt.py index e3a2dfa..419862c 100644 --- a/passlib/handlers/md5_crypt.py +++ b/passlib/handlers/md5_crypt.py @@ -9,7 +9,6 @@ import logging; log = logging.getLogger(__name__) # pkg from passlib.utils import safe_crypt, test_crypt, repeat_string from passlib.utils.binary import h64 -from passlib.utils.compat import unicode, u import passlib.utils.handlers as uh # local __all__ = [ @@ -67,15 +66,15 @@ def _raw_md5_crypt(pwd, salt, use_apr=False): # validate secret # XXX: not sure what official unicode policy is, using this as default - if isinstance(pwd, unicode): + if isinstance(pwd, str): pwd = pwd.encode("utf-8") - assert isinstance(pwd, bytes), "pwd not unicode or bytes" + assert isinstance(pwd, bytes), "pwd not str or bytes" if _BNULL in pwd: raise uh.exc.NullPasswordError(md5_crypt) pwd_len = len(pwd) # validate salt - should have been taken care of by caller - assert isinstance(salt, unicode), "salt not unicode" + assert isinstance(salt, str), "salt not str" salt = salt.encode("ascii") assert len(salt) < 9, "salt too large" # NOTE: spec says salts larger than 8 bytes should be truncated, @@ -255,7 +254,7 @@ class md5_crypt(uh.HasManyBackends, _MD5_Common): # class attrs #=================================================================== name = "md5_crypt" - ident = u("$1$") + ident = u"$1$" #=================================================================== # methods @@ -329,7 +328,7 @@ class apr_md5_crypt(_MD5_Common): # class attrs #=================================================================== name = "apr_md5_crypt" - ident = u("$apr1$") + ident = u"$apr1$" #=================================================================== # methods |