@@ -69,8 +69,7 @@ def validate_email_local_part(local: str, allow_smtputf8: bool = True, allow_emp
6969 # so if it was originally quoted (quoted_local_part is True) and this regex matches,
7070 # it's ok.
7171 # (RFC 5321 4.1.2 / RFC 5322 3.2.4).
72- m = DOT_ATOM_TEXT .match (local )
73- if m :
72+ if DOT_ATOM_TEXT .match (local ):
7473 # It's valid. And since it's just the permitted ASCII characters,
7574 # it's normalized and safe. If the local part was originally quoted,
7675 # the quoting was unnecessary and it'll be returned as normalized to
@@ -89,8 +88,7 @@ def validate_email_local_part(local: str, allow_smtputf8: bool = True, allow_emp
8988 # RFC 6531 section 3.3.
9089 valid : Optional [str ] = None
9190 requires_smtputf8 = False
92- m = DOT_ATOM_TEXT_INTL .match (local )
93- if m :
91+ if DOT_ATOM_TEXT_INTL .match (local ):
9492 # But international characters in the local part may not be permitted.
9593 if not allow_smtputf8 :
9694 # Check for invalid characters against the non-internationalized
@@ -347,8 +345,7 @@ def validate_email_domain_name(domain, test_environment=False, globally_delivera
347345
348346 # Check the syntax of the string returned by idna.encode.
349347 # It should never fail.
350- m = DOT_ATOM_TEXT_HOSTNAME .match (ascii_domain )
351- if not m :
348+ if not DOT_ATOM_TEXT_HOSTNAME .match (ascii_domain ):
352349 raise EmailSyntaxError ("The email address contains invalid characters after the @-sign after IDNA encoding." )
353350
354351 # Check the length of the domain name in bytes.
0 commit comments