diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-12-18 19:27:36 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-12-18 19:27:36 -0800 |
commit | 01aa770768e8dcb1c776c7b869d2ec050bf8010b (patch) | |
tree | 26f02ea728f2f912d240f3be5a410d9c5e1c074e /src/cryptography/exceptions.py | |
parent | c8c3331afdff6cc9558843a60a82f1858825ace1 (diff) | |
download | cryptography-01aa770768e8dcb1c776c7b869d2ec050bf8010b.tar.gz cryptography-01aa770768e8dcb1c776c7b869d2ec050bf8010b.tar.bz2 cryptography-01aa770768e8dcb1c776c7b869d2ec050bf8010b.zip |
made the internal _Reasons an enum, since we already depend on enum34
fixes #854
Diffstat (limited to 'src/cryptography/exceptions.py')
-rw-r--r-- | src/cryptography/exceptions.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/cryptography/exceptions.py b/src/cryptography/exceptions.py index b0e1a993..102165c7 100644 --- a/src/cryptography/exceptions.py +++ b/src/cryptography/exceptions.py @@ -4,17 +4,19 @@ from __future__ import absolute_import, division, print_function - -class _Reasons(object): - BACKEND_MISSING_INTERFACE = object() - UNSUPPORTED_HASH = object() - UNSUPPORTED_CIPHER = object() - UNSUPPORTED_PADDING = object() - UNSUPPORTED_MGF = object() - UNSUPPORTED_PUBLIC_KEY_ALGORITHM = object() - UNSUPPORTED_ELLIPTIC_CURVE = object() - UNSUPPORTED_SERIALIZATION = object() - UNSUPPORTED_X509 = object() +from enum import Enum + + +class _Reasons(Enum): + BACKEND_MISSING_INTERFACE = 0 + UNSUPPORTED_HASH = 1 + UNSUPPORTED_CIPHER = 2 + UNSUPPORTED_PADDING = 3 + UNSUPPORTED_MGF = 4 + UNSUPPORTED_PUBLIC_KEY_ALGORITHM = 5 + UNSUPPORTED_ELLIPTIC_CURVE = 6 + UNSUPPORTED_SERIALIZATION = 7 + UNSUPPORTED_X509 = 8 class UnsupportedAlgorithm(Exception): |