Skip to content

Commit fbcf145

Browse files
authored
Fix bug in ValidatedEmail method __eq__() (#66)
Check parameter `other` is an instance of ValidatedEmail before checking all its members are equal to self's members.
1 parent 1682bda commit fbcf145

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

email_validator/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def __getitem__(self, key):
142142

143143
"""Tests use this."""
144144
def __eq__(self, other):
145+
if not isinstance(other, ValidatedEmail):
146+
return False
145147
return (
146148
self.email == other.email
147149
and self.local_part == other.local_part

0 commit comments

Comments
 (0)