From dee41bb04906d6976b4f7c05c222f7d95182b3ea Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 16 Aug 2017 11:37:31 -0700 Subject: 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. --- alot/crypto.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'alot/crypto.py') 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 -- cgit v1.2.3