diff options
Diffstat (limited to 'passlib/utils')
| -rw-r--r-- | passlib/utils/__init__.py | 4 | ||||
| -rw-r--r-- | passlib/utils/des.py | 6 | ||||
| -rw-r--r-- | passlib/utils/md4.py | 7 |
3 files changed, 8 insertions, 9 deletions
diff --git a/passlib/utils/__init__.py b/passlib/utils/__init__.py index fc90055..4e29259 100644 --- a/passlib/utils/__init__.py +++ b/passlib/utils/__init__.py @@ -473,7 +473,7 @@ def saslprep(source, param="value"): return data # replace saslprep() with stub when stringprep is missing -if stringprep is None: +if stringprep is None: # pragma: no cover -- runtime detection def saslprep(source, param="value"): "stub for saslprep()" raise NotImplementedError("saslprep() support requires the 'stringprep' " @@ -669,7 +669,7 @@ add_doc(to_native_str, """) @deprecated_function(deprecated="1.6", removed="1.7") -def to_hash_str(source, encoding="ascii"): # pragma: no cover +def to_hash_str(source, encoding="ascii"): # pragma: no cover -- deprecated & unused "deprecated, use to_native_str() instead" return to_native_str(source, encoding, param="hash") diff --git a/passlib/utils/des.py b/passlib/utils/des.py index 25f1d0d..f21de4d 100644 --- a/passlib/utils/des.py +++ b/passlib/utils/des.py @@ -844,9 +844,9 @@ def des_encrypt_int_block(key, input, salt=0, rounds=1): ) return _permute(C, CF6464) -def mdes_encrypt_int_block(key, input, salt=0, rounds=1): # pragma: no cover - warn("mdes_encrypt_int_block() has been deprecated as of Passlib 1.6," - "and will be removed in Passlib 1.8, use des_encrypt_int_block instead.") +@deprecated_function(deprecated="1.6", removed="1.8", + replacement="des_encrypt_int_block()") +def mdes_encrypt_int_block(key, input, salt=0, rounds=1): # pragma: no cover -- deprecated & unused if isinstance(key, bytes): if len(key) == 7: key = expand_des_key(key) diff --git a/passlib/utils/md4.py b/passlib/utils/md4.py index 2dd6da9..63f0d1b 100644 --- a/passlib/utils/md4.py +++ b/passlib/utils/md4.py @@ -238,7 +238,7 @@ _builtin_md4 = md4 import hashlib from passlib.utils import PYPY -def _has_native_md4(): +def _has_native_md4(): # pragma: no cover -- runtime detection try: h = hashlib.new("md4") except ValueError: @@ -250,10 +250,9 @@ def _has_native_md4(): if PYPY and result == '': # workaround for https://bugs.pypy.org/issue957, fixed in PyPy 1.8 return False - #anything else should alert user + # anything else and we should alert user from passlib.exc import PasslibRuntimeWarning - warn("native md4 support disabled, incorrect value returned!", - PasslibRuntimeWarning) + warn("native md4 support disabled, sanity check failed!", PasslibRuntimeWarning) return False if _has_native_md4(): |
