Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mypy error in sydent/utils/emailutils.py #360

Merged
merged 4 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -119,15 +119,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