summaryrefslogtreecommitdiff
path: root/passlib/utils/handlers.py
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2016-11-27 14:13:47 -0500
committerEli Collins <elic@assurancetechnologies.com>2016-11-27 14:13:47 -0500
commit210537f1210e13f17efa734ea080f1d70d605603 (patch)
treeb7094479b8f31aefd6f798bb1ae60e38a0938799 /passlib/utils/handlers.py
parentf32a08ecb482f97a06ee944af183f032c7dfee38 (diff)
downloadpasslib-210537f1210e13f17efa734ea080f1d70d605603.tar.gz
bugfix: utils: GenericHandler wasn't issuing deprecation warning if caller
passed settings keywords to .encrypt() / .hash(). * Enabled warn() call, made it a DeprecationWarning * Audited test suite to - remove any (unintended) calls to .hash(**settings) - do assert check on warnings that *should* be there
Diffstat (limited to 'passlib/utils/handlers.py')
-rw-r--r--passlib/utils/handlers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/passlib/utils/handlers.py b/passlib/utils/handlers.py
index 3e5daef..a0c1f51 100644
--- a/passlib/utils/handlers.py
+++ b/passlib/utils/handlers.py
@@ -89,7 +89,7 @@ def guess_app_stacklevel(start=1):
try:
while frame:
name = frame.f_globals.get('__name__', "")
- if not name.startswith("passlib.") or name.startswith("passlib.tests."):
+ if name.startswith("passlib.tests.") or not name.startswith("passlib."):
return max(1, count)
count += 1
frame = frame.f_back
@@ -100,7 +100,7 @@ def guess_app_stacklevel(start=1):
def warn_hash_settings_deprecation(handler, kwds):
warn("passing settings to %(handler)s.hash() is deprecated, and won't be supported in Passlib 2.0; "
"use '%(handler)s.using(**settings).hash(secret)' instead" % dict(handler=handler.name),
- stacklevel=guess_app_stacklevel(2))
+ DeprecationWarning, stacklevel=guess_app_stacklevel(2))
def extract_settings_kwds(handler, kwds):
"""