diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-08-16 11:37:31 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2017-08-19 12:52:26 -0700 |
commit | dee41bb04906d6976b4f7c05c222f7d95182b3ea (patch) | |
tree | 2dbe16e47e3b8fee167d9375e83bd42585e78464 /alot/crypto.py | |
parent | 188d79a0189b480656542a09be348fcbf506f33d (diff) |
Replace Exception.message with str(Exception)
In python3 Exception doesn't have a message attribute, the only way to
get the string output is to call str() on the Exception. This also works
in python 2.7, so go ahead and make that change.
Diffstat (limited to 'alot/crypto.py')
-rw-r--r-- | alot/crypto.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/alot/crypto.py b/alot/crypto.py index cd03d9e7..52eb8c58 100644 --- a/alot/crypto.py +++ b/alot/crypto.py @@ -196,7 +196,7 @@ def verify_detached(message, signature): except gpg.errors.BadSignatures as e: raise GPGProblem(str(e), code=GPGCode.BAD_SIGNATURE) except gpg.errors.GPGMEError as e: - raise GPGProblem(e.message, code=e.getcode()) + raise GPGProblem(str(e), code=e.getcode()) def decrypt_verify(encrypted): @@ -212,7 +212,7 @@ def decrypt_verify(encrypted): try: (plaintext, _, verify_result) = ctx.decrypt(encrypted, verify=True) except gpg.errors.GPGMEError as e: - raise GPGProblem(e.message, code=e.getcode()) + raise GPGProblem(str(e), code=e.getcode()) # what if the signature is bad? return verify_result.signatures, plaintext |