From 4f43e7cc808110d4ba1d213fa97fde1106009a5e Mon Sep 17 00:00:00 2001 From: j-t-1 <120829237+j-t-1@users.noreply.github.com> Date: Tue, 2 Jul 2024 10:58:12 +0100 Subject: [PATCH] STY: Use endswith instead of logical equals (#2732) --- pypdf/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypdf/_utils.py b/pypdf/_utils.py index 27c64a6fc..975653698 100644 --- a/pypdf/_utils.py +++ b/pypdf/_utils.py @@ -100,7 +100,7 @@ def parse_iso8824_date(text: Optional[str]) -> Optional[datetime]: except ValueError: continue else: - if text[-5:] == "+0000": + if text.endswith("+0000"): d = d.replace(tzinfo=timezone.utc) return d raise ValueError(f"Can not convert date: {orgtext}")