summaryrefslogtreecommitdiff
path: root/passlib/context.py
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2020-10-07 14:46:57 -0400
committerEli Collins <elic@assurancetechnologies.com>2020-10-07 14:46:57 -0400
commit7086228eec5138cd40d39e18c7a132b703d07cdc (patch)
treef94719c8916600054ac764a3100fa4d63404553b /passlib/context.py
parentd221b9006a1370a79bc19b8b645250d2bf35397c (diff)
downloadpasslib-7086228eec5138cd40d39e18c7a132b703d07cdc.tar.gz
passlib.context: now raises UnknownHashError() if hash can't be identified.
this inherits from ValueError, and has same text, so backwards compatible.
Diffstat (limited to 'passlib/context.py')
-rw-r--r--passlib/context.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/passlib/context.py b/passlib/context.py
index 2822d70..bc3cbf5 100644
--- a/passlib/context.py
+++ b/passlib/context.py
@@ -11,6 +11,7 @@ import time
from warnings import warn
# site
# pkg
+from passlib import exc
from passlib.exc import ExpectedStringError, ExpectedTypeError, PasslibConfigWarning
from passlib.registry import get_crypt_handler, _validate_handler_name
from passlib.utils import (handlers as uh, to_bytes,
@@ -1128,7 +1129,7 @@ class _CryptConfig(object):
elif not self.schemes:
raise KeyError("no crypt algorithms supported")
else:
- raise ValueError("hash could not be identified")
+ raise exc.UnknownHashError("hash could not be identified")
@memoized_property
def disabled_record(self):