Skip to content

Commit

Permalink
STY: Use startswith
Browse files Browse the repository at this point in the history
  • Loading branch information
j-t-1 authored Nov 28, 2024
1 parent ec3779b commit a1ba3b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pypdf/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ def _find_eof_marker(self, stream: StreamType) -> None:
HEADER_SIZE = 8 # to parse whole file, Header is e.g. '%PDF-1.6'
line = b""
first = True
while not line.startswith(b"%%EOF")
while not line.startswith(b"%%EOF"):
if line != b"" and first:
if any(
line.strip().endswith(tr) for tr in (b"%%EO", b"%%E", b"%%", b"%")
Expand Down

0 comments on commit a1ba3b3

Please sign in to comment.