Skip to content

Commit

Permalink
fix: do not gett value of already cached self.policy.linesep
Browse files Browse the repository at this point in the history
Fixes: python#122989
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
  • Loading branch information
mcepl committed Aug 14, 2024
1 parent 6ae942f commit eb7c777
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/email/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _write_headers(self, msg):
folded = self.policy.fold(h, v)
if self.policy.verify_generated_headers:
linesep = self.policy.linesep
if not folded.endswith(self.policy.linesep):
if not folded.endswith(linesep):
raise HeaderWriteError(
f'folded header does not end with {linesep!r}: {folded!r}')
if NEWLINE_WITHOUT_FWSP.search(folded.removesuffix(linesep)):
Expand Down

0 comments on commit eb7c777

Please sign in to comment.