Skip to content

Commit

Permalink
STY: Remove duplicated comments (#2860)
Browse files Browse the repository at this point in the history
* STY: Remove duplicated comments

These are the same as the next line exception messages.
Also fix one typo.

* STY: Remove duplicated comments

These are the same as the next line exception messages.
Also fix one typo and change a link.
  • Loading branch information
j-t-1 authored Sep 20, 2024
1 parent 36e1245 commit a337664
Showing 1 changed file with 3 additions and 6 deletions.
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

0 comments on commit a337664

Please sign in to comment.