# HG changeset patch # User Søren Løvborg # Date 2015-07-26 13:58:50 # Node ID 102bbfe8af43fe63edb4a3e5f1acf3b8d54818e9 # Parent 71c2b7054e5524da45f102ed3df0dd6418c07628 auth: remove redundant hashlib imports hashlib is already imported at the top of the module (regardless of OS). diff --git a/kallithea/lib/auth.py b/kallithea/lib/auth.py --- a/kallithea/lib/auth.py +++ b/kallithea/lib/auth.py @@ -105,8 +105,7 @@ class KallitheaCrypto(object): :param password: password to hash """ if is_windows: - from hashlib import sha256 - return sha256(str_).hexdigest() + return hashlib.sha256(str_).hexdigest() elif is_unix: import bcrypt return bcrypt.hashpw(str_, bcrypt.gensalt(10)) @@ -125,8 +124,7 @@ class KallitheaCrypto(object): """ if is_windows: - from hashlib import sha256 - return sha256(password).hexdigest() == hashed + return hashlib.sha256(password).hexdigest() == hashed elif is_unix: import bcrypt return bcrypt.hashpw(password, hashed) == hashed