Skip to content

Commit

Permalink
DOC: Improve two docstrings (py-pdf#2945)
Browse files Browse the repository at this point in the history
deprecate_with_replacement and deprecate_no_replacement are not raising exceptions, but are issuing warnings. Change their docstrings to reflect this.
  • Loading branch information
j-t-1 authored Nov 15, 2024
1 parent 03f7140 commit 65f4680
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pypdf/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def deprecation(msg: str) -> None:


def deprecate_with_replacement(old_name: str, new_name: str, removed_in: str) -> None:
"""Raise an exception that a feature will be removed, but has a replacement."""
"""Issue a warning that a feature will be removed, but has a replacement."""
deprecate(
f"{old_name} is deprecated and will be removed in pypdf {removed_in}. Use {new_name} instead.",
4,
Expand All @@ -394,7 +394,7 @@ def deprecation_with_replacement(old_name: str, new_name: str, removed_in: str)


def deprecate_no_replacement(name: str, removed_in: str) -> None:
"""Raise an exception that a feature will be removed without replacement."""
"""Issue a warning that a feature will be removed without replacement."""
deprecate(f"{name} is deprecated and will be removed in pypdf {removed_in}.", 4)


Expand Down

0 comments on commit 65f4680

Please sign in to comment.