Skip to content

Commit

Permalink
pythongh-127794: Remove one variable
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy committed Dec 13, 2024
1 parent fae3664 commit 026f35b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Lib/email/_policybase.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __add__(self, other):
"""
return self.clone(**other.__dict__)

def validate_header(name, value):
def validate_header(name):
# Validate header name according to RFC 5322
import re
if not re.match(r'^[^\s:]+$', name):
Expand Down Expand Up @@ -322,7 +322,7 @@ def header_store_parse(self, name, value):
"""+
The name and value are returned unmodified.
"""
validate_header(name, value)
validate_header(name)
return (name, value)

def header_fetch_parse(self, name, value):
Expand Down
2 changes: 1 addition & 1 deletion Lib/email/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def header_store_parse(self, name, value):
"""
if hasattr(value, 'name') and value.name.lower() == name.lower():
return (name, value)
validate_header(name, value)
validate_header(name)
if isinstance(value, str) and len(value.splitlines())>1:
# XXX this error message isn't quite right when we use splitlines
# (see issue 22233), but I'm not sure what should happen here.
Expand Down

0 comments on commit 026f35b

Please sign in to comment.