@@ -69,8 +69,7 @@ def validate_email_local_part(local: str, allow_smtputf8: bool = True, allow_emp
69
69
# so if it was originally quoted (quoted_local_part is True) and this regex matches,
70
70
# it's ok.
71
71
# (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 ):
74
73
# It's valid. And since it's just the permitted ASCII characters,
75
74
# it's normalized and safe. If the local part was originally quoted,
76
75
# 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
89
88
# RFC 6531 section 3.3.
90
89
valid : Optional [str ] = None
91
90
requires_smtputf8 = False
92
- m = DOT_ATOM_TEXT_INTL .match (local )
93
- if m :
91
+ if DOT_ATOM_TEXT_INTL .match (local ):
94
92
# But international characters in the local part may not be permitted.
95
93
if not allow_smtputf8 :
96
94
# Check for invalid characters against the non-internationalized
@@ -347,8 +345,7 @@ def validate_email_domain_name(domain, test_environment=False, globally_delivera
347
345
348
346
# Check the syntax of the string returned by idna.encode.
349
347
# 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 ):
352
349
raise EmailSyntaxError ("The email address contains invalid characters after the @-sign after IDNA encoding." )
353
350
354
351
# Check the length of the domain name in bytes.
0 commit comments