diff options
Diffstat (limited to 'alot/db')
-rw-r--r-- | alot/db/envelope.py | 9 | ||||
-rw-r--r-- | alot/db/utils.py | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/alot/db/envelope.py b/alot/db/envelope.py index 0a6d4f58..3dc12278 100644 --- a/alot/db/envelope.py +++ b/alot/db/envelope.py @@ -13,8 +13,7 @@ from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.application import MIMEApplication import email.charset as charset - -import gpgme +import gpg from .attachment import Attachment from .utils import encode_header @@ -197,8 +196,8 @@ class Envelope(object): raise GPGProblem("Could not sign message (GPGME " "did not return a signature)", code=GPGCode.KEY_CANNOT_SIGN) - except gpgme.GpgmeError as e: - if e.code == gpgme.ERR_BAD_PASSPHRASE: + except gpg.errors.GPGMEError as e: + if e.getcode() == gpg.errors.BAD_PASSPHRASE: # If GPG_AGENT_INFO is unset or empty, the user just does # not have gpg-agent running (properly). if os.environ.get('GPG_AGENT_INFO', '').strip() == '': @@ -237,7 +236,7 @@ class Envelope(object): try: encrypted_str = crypto.encrypt(plaintext, self.encrypt_keys.values()) - except gpgme.GpgmeError as e: + except gpg.errors.GPGMEError as e: raise GPGProblem(str(e), code=GPGCode.KEY_CANNOT_ENCRYPT) outer_msg = MIMEMultipart('encrypted', diff --git a/alot/db/utils.py b/alot/db/utils.py index 3cff108a..994e85b2 100644 --- a/alot/db/utils.py +++ b/alot/db/utils.py @@ -35,7 +35,7 @@ def add_signature_headers(mail, sigs, error_msg): verification was successful. :param mail: :class:`email.message.Message` the message to entitle - :param sigs: list of :class:`gpgme.Signature` + :param sigs: list of :class:`gpg.results.Signature` :param error_msg: `str` containing an error message, the empty string indicating no error ''' |