Skip to content

Commit f1e81eb

Browse files
committed
Fix incorrect isinstance check in parse_name_and_email_list
The condition on line 134 was checking `isinstance(e, string_types)` twice instead of checking `n` in the second test. This caused the name type validation to be silently skipped. Fixes #167
1 parent b6680ac commit f1e81eb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

emails/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def parse_name_and_email_list(elements, encoding='utf-8'):
131131
# Let's do some guesses
132132
if isinstance(elements, tuple):
133133
n, e = elements
134-
if isinstance(e, string_types) and (not n or isinstance(e, string_types)):
134+
if isinstance(e, string_types) and (not n or isinstance(n, string_types)):
135135
# It is probably a pair (name, email)
136136
return [parse_name_and_email(elements, encoding), ]
137137

0 commit comments

Comments
 (0)