summaryrefslogtreecommitdiff
path: root/alot/helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/helper.py')
-rw-r--r--alot/helper.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/alot/helper.py b/alot/helper.py
index 4d8d782e..e621f751 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -640,7 +640,9 @@ def email_as_bytes(mail):
# If we get here and the assert triggers it means that different
# parts of the email are encoded differently. I don't think we're
# likely to see that, but it's possible
- assert {'utf-8', 'ascii', 'us-ascii'}.issuperset(charsets), charsets
+ if not {'utf-8', 'ascii', 'us-ascii'}.issuperset(charsets):
+ raise RuntimeError(
+ "different encodings detected: {}".format(charsets))
charset = 'utf-8' # It's a strict super-set
else:
charset = 'utf-8'