From 91ff700de28f3415cbe44f58ce84a2670b8c9f15 Mon Sep 17 00:00:00 2001 From: Damien <81557462+Damien-Chen@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:30:25 +0800 Subject: =?UTF-8?q?gh-122989:=20Replace=20duplicate=20=E2=80=9Cself.policy?= =?UTF-8?q?.linesep=E2=80=9D=20=20with=20=E2=80=9Clinesep=E2=80=9D=20(#123?= =?UTF-8?q?002)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `linesep` is already defined as `self.policy.linesep`. It appears that previous refactor was not completed. --- Lib/email/generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/email/generator.py b/Lib/email/generator.py index 42c84aa..205caf0 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)): -- cgit v0.12