diff --git a/apistar_mail/mail.py b/apistar_mail/mail.py index 9bd43cd..6acc5cd 100644 --- a/apistar_mail/mail.py +++ b/apistar_mail/mail.py @@ -43,7 +43,7 @@ def force_text(s, encoding='utf-8', errors='strict', ): raise MailUnicodeDecodeError(s, *e.args) else: s = ' '.join([force_text(arg, encoding, errors) for arg in s]) - except: + except UnicodeDecodeError as e: raise MailUnicodeDecodeError(s, *e.args) return s @@ -112,9 +112,6 @@ def _has_newline(line): return False - - - class Attachment: """Encapsulates file attachment information.