Skip to content

Commit

Permalink
STY: Import TextStringObject at the top of file (#3065)
Browse files Browse the repository at this point in the history
EncodedStreamObject and DecodedStreamObject are only used once within the same if statement as TextStringObject. For consistency import TextStringObject with these at the top of the file.
  • Loading branch information
j-t-1 authored Jan 21, 2025
1 parent 861c5c1 commit 23d3f41
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pypdf/_xobj_image_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
EncodedStreamObject,
IndirectObject,
NullObject,
TextStringObject,
)

if sys.version_info[:2] >= (3, 10):
Expand Down Expand Up @@ -184,8 +185,6 @@ def _handle_flate(
data = bits2byte(data, size, 4)
img = _extended_image_frombytes(mode, size, data)
if color_space == "/Indexed":
from .generic import TextStringObject

if isinstance(lookup, (EncodedStreamObject, DecodedStreamObject)):
lookup = lookup.get_data()
if isinstance(lookup, TextStringObject):
Expand Down

0 comments on commit 23d3f41

Please sign in to comment.