diff options
Diffstat (limited to 'passlib/handlers/postgres.py')
-rw-r--r-- | passlib/handlers/postgres.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/passlib/handlers/postgres.py b/passlib/handlers/postgres.py index 17156fa..abe7663 100644 --- a/passlib/handlers/postgres.py +++ b/passlib/handlers/postgres.py @@ -8,7 +8,6 @@ import logging; log = logging.getLogger(__name__) # site # pkg from passlib.utils import to_bytes -from passlib.utils.compat import str_to_uascii, unicode, u import passlib.utils.handlers as uh # local __all__ = [ @@ -33,7 +32,7 @@ class postgres_md5(uh.HasUserContext, uh.StaticHandler): # algorithm information #=================================================================== name = "postgres_md5" - _hash_prefix = u("md5") + _hash_prefix = u"md5" checksum_chars = uh.HEX_CHARS checksum_size = 32 @@ -41,10 +40,10 @@ class postgres_md5(uh.HasUserContext, uh.StaticHandler): # primary interface #=================================================================== def _calc_checksum(self, secret): - if isinstance(secret, unicode): + if isinstance(secret, str): secret = secret.encode("utf-8") user = to_bytes(self.user, "utf-8", param="user") - return str_to_uascii(md5(secret + user).hexdigest()) + return md5(secret + user).hexdigest() #=================================================================== # eoc |