Skip to content

Commit

Permalink
Merge branch 'main' into issue-1059
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma authored Jul 5, 2022
2 parents 27aee57 + 1e9c4dd commit ba043a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion PyPDF2/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ def compress_content_streams(self) -> None:
applying a FlateDecode filter.
However, it is possible that this function will perform no action if
content stream compression becomes "automatic" for some reason.
content stream compression becomes "automatic".
"""
content = self.get_contents()
if content is not None:
Expand Down
1 change: 0 additions & 1 deletion PyPDF2/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
float, float, float, float, float, float
]

bytes_type = bytes # Works the same in Python 2.X and 3.X
StreamType = Union[BytesIO, BufferedReader, BufferedWriter, FileIO]
StrByteType = Union[str, StreamType]

Expand Down
5 changes: 2 additions & 3 deletions PyPDF2/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
WHITESPACES,
StreamType,
b_,
bytes_type,
deprecate_no_replacement,
deprecate_with_replacement,
hex_str,
Expand Down Expand Up @@ -496,7 +495,7 @@ def read_string_from_stream(
return create_string_object(txt, forced_encoding)


class ByteStringObject(bytes_type, PdfObject): # type: ignore
class ByteStringObject(bytes, PdfObject): # type: ignore
"""
Represents a string object where the text encoding could not be determined.
This occurs quite often, as the PDF spec doesn't provide an alternate way to
Expand Down Expand Up @@ -1897,7 +1896,7 @@ def create_string_object(
"""
if isinstance(string, str):
return TextStringObject(string)
elif isinstance(string, bytes_type):
elif isinstance(string, bytes):
if isinstance(forced_encoding, (list, dict)):
out = ""
for x in string:
Expand Down

0 comments on commit ba043a4

Please sign in to comment.