Skip to content

Commit

Permalink
Fix mypy error in sydent/utils/emailutils.py (#360)
Browse files Browse the repository at this point in the history
per this: #355 (comment)

Signed-off-by: H.Shay <shaysquared@gmail.com>
  • Loading branch information
H-Shay authored Jun 15, 2021
1 parent 56fbed0 commit b798a83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/360.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a mypy error in utils/emailutils.
7 changes: 2 additions & 5 deletions sydent/util/emailutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import string
import urllib
from html import escape
from typing import TYPE_CHECKING, Any, Dict
from typing import TYPE_CHECKING, Dict

import twisted.python.log

Expand Down Expand Up @@ -120,15 +120,12 @@ def sendEmail(
smtp.quit()
except Exception as origException:
twisted.python.log.err()
ese = EmailSendException()
ese.cause = origException
raise ese
raise EmailSendException() from origException


class EmailAddressException(Exception):
pass


class EmailSendException(Exception):
cause: Any # type hint added to prevent ""EmailSendException" has no attribute "cause"" error in Mypy
pass

0 comments on commit b798a83

Please sign in to comment.