Skip to content

Commit 5881622

Browse files
authored
STY: Initialize variable extra using skip_over_whitespace (#3043)
Also tweak comment in skip_over_whitespace.
1 parent 420e99e commit 5881622

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pypdf/_reader.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,8 @@ def read_object_header(self, stream: StreamType) -> Tuple[int, int]:
513513
# cross-reference table should put us in the right spot to read the
514514
# object header. In reality some files have stupid cross-reference
515515
# tables that are off by whitespace bytes.
516-
extra = False
517516
skip_over_comment(stream)
518-
extra |= skip_over_whitespace(stream)
517+
extra = skip_over_whitespace(stream)
519518
stream.seek(-1, 1)
520519
idnum = read_until_whitespace(stream)
521520
extra |= skip_over_whitespace(stream)

pypdf/_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def read_non_whitespace(stream: StreamType) -> bytes:
173173

174174
def skip_over_whitespace(stream: StreamType) -> bool:
175175
"""
176-
Similar to read_non_whitespace, but return a boolean if more than one
176+
Similar to read_non_whitespace, but return a boolean if at least one
177177
whitespace character was read.
178178
179179
Args:

0 commit comments

Comments
 (0)