Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Remove duplicated comments #2860

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions pypdf/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def decode(
PdfReadError:
"""
if isinstance(decode_parms, ArrayObject):
raise DeprecationError("decode_parms as ArrayObject is depreciated")
raise DeprecationError("decode_parms as ArrayObject is deprecated")

str_data = decompress(data)
predictor = 1
Expand Down Expand Up @@ -169,7 +169,6 @@ def decode(
str_data, columns, rowlength
)
else:
# unsupported predictor
raise PdfReadError(f"Unsupported flatedecode predictor {predictor!r}")
return str_data

Expand Down Expand Up @@ -228,7 +227,6 @@ def _decode_png_prediction(data: bytes, columns: int, rowlength: int) -> bytes:

rowdata[i] = (rowdata[i] + paeth) % 256
else:
# unsupported PNG filter
raise PdfReadError(
f"Unsupported PNG filter {filter_byte!r}"
) # pragma: no cover
Expand Down Expand Up @@ -372,7 +370,7 @@ class LZWDecode:
"""
Taken from:

http://www.java2s.com/Open-Source/Java-Document/PDF/PDF-Renderer/com/sun/pdfview/decode/LZWDecode.java.htm
https://github.com/katjas/PDFrenderer/blob/master/src/com/sun/pdfview/decode/LZWDecode.java
"""

class Decoder:
Expand Down Expand Up @@ -717,8 +715,7 @@ def decode_stream_data(stream: Any) -> bytes: # utils.StreamObject
"/Crypt filter with /Name or /Type not supported yet"
)
else:
# Unsupported filter
raise NotImplementedError(f"unsupported filter {filter_type}")
raise NotImplementedError(f"Unsupported filter {filter_type}")
return data


Expand Down
Loading