Skip to content

Commit

Permalink
fix py 3.7 incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0nx committed Oct 28, 2022
1 parent 712b873 commit ed8ce93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eml_parser/eml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ def parse_email(self) -> dict:
# workaround for bad message-id formats
if k.lower() == 'message-id' and not eml_parser.regexes.email_regex.match(v):
# try workaround for bad message-id formats
if m := eml_parser.regexes.email_regex.search(v):
m = eml_parser.regexes.email_regex.search(v)
if m:
try:
self.msg.replace_header(k, m.group(1))
except KeyError:
Expand Down

0 comments on commit ed8ce93

Please sign in to comment.