diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-08-14 19:18:06 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-08-14 19:19:01 +0200 |
commit | 36c5b59453617a0108b0b78e5fad6483804ad595 (patch) | |
tree | 6f5e9124beb2f759de8236cdc2b41b4852b89069 /scripts/icehashpassword.py | |
parent | Always run Xamarin tests in main thread (diff) | |
download | ice-36c5b59453617a0108b0b78e5fad6483804ad595.tar.bz2 ice-36c5b59453617a0108b0b78e5fad6483804ad595.tar.xz ice-36c5b59453617a0108b0b78e5fad6483804ad595.zip |
Fixed icehashpassword deprecation warning with python debug
Diffstat (limited to 'scripts/icehashpassword.py')
-rwxr-xr-x | scripts/icehashpassword.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/icehashpassword.py b/scripts/icehashpassword.py index 92e8932af63..486c417042e 100755 --- a/scripts/icehashpassword.py +++ b/scripts/icehashpassword.py @@ -119,9 +119,6 @@ def main(): usage() return 2 - # passlib 1.7 renamed encrypt to hash - encryptfn = passScheme.hash if hasattr(passScheme, "hash") else passScheme.encrypt - args = [] if sys.stdout.isatty(): args.append(getpass.getpass("Password: ")) @@ -135,7 +132,11 @@ def main(): if rounds: opts["rounds"] = rounds - print(encryptfn(*args, **opts)) + # passlib 1.7 renamed encrypt to hash + if hasattr(passScheme, "hash"): + print(passScheme.using(**opts).hash(*args)) + else: + print(passScheme.encrypt(*args, **opts)) return 0 |