Skip to content

Commit

Permalink
Fix deprecation message
Browse files Browse the repository at this point in the history
Missing f-string.
  • Loading branch information
khaledhosny committed Sep 19, 2024
1 parent ddd872e commit 1d8f1fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/uharfbuzz/_harfbuzz.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ def version_string() -> str:
WARNED = set()


def deprecated(alternate=None):
def deprecated(replacement=None):
"""Decorator to raise a warning when a deprecated function is called."""

def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
message = f"{func.__name__!r} is deprecated"
if alternate:
message += ", use {alternate} instead"
if replacement:
message += f", use {replacement} instead"
if message not in WARNED:
warnings.warn(message, DeprecationWarning, stacklevel=2)
WARNED.add(message)
Expand Down

0 comments on commit 1d8f1fe

Please sign in to comment.