From: Damien <81557462+Damien-Chen@users.noreply.github.com> Date: Wed, 4 Sep 2024 06:30:25 +0000 (+0800) Subject: gh-122989: Replace duplicate “self.policy.linesep” with “linesep” (#123002) X-Git-Tag: v3.14.0a1~596 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91ff700de28f3415cbe44f58ce84a2670b8c9f15;p=thirdparty%2FPython%2Fcpython.git gh-122989: Replace duplicate “self.policy.linesep” with “linesep” (#123002) `linesep` is already defined as `self.policy.linesep`. It appears that previous refactor was not completed. --- diff --git a/Lib/email/generator.py b/Lib/email/generator.py index 42c84aa4da10..205caf0fe9e8 100644 --- a/Lib/email/generator.py +++ b/Lib/email/generator.py @@ -227,7 +227,7 @@ class Generator: 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)):