# HG changeset patch # User Søren Løvborg # Date 1437911930 -7200 # Node ID 102bbfe8af43fe63edb4a3e5f1acf3b8d54818e9 # Parent 71c2b7054e5524da45f102ed3df0dd6418c07628 auth: remove redundant hashlib imports hashlib is already imported at the top of the module (regardless of OS). diff -r 71c2b7054e55 -r 102bbfe8af43 kallithea/lib/auth.py --- a/kallithea/lib/auth.py Sun Jul 26 13:58:50 2015 +0200 +++ b/kallithea/lib/auth.py Sun Jul 26 13:58:50 2015 +0200 @@ -105,8 +105,7 @@ :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 @@ """ 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