summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
Diffstat (limited to 'alot')
-rw-r--r--alot/db/envelope.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 2d54646d..61d8d19d 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -171,7 +171,9 @@ class Envelope(object):
except pyme.errors.GPGMEError as e:
# 11 == GPG_ERR_BAD_PASSPHRASE
if e.getcode() == 11:
- if not os.environ.has_key('GPG_AGENT_INFO'):
+ # 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() == '':
raise ConstructMailError(("Bad passphrase and "
"GPG_AGENT_INFO not set. Please setup "
"gpg-agent."))