Skip to content

Commit

Permalink
fix mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
dulmandakh committed Jul 6, 2024
1 parent c23ff11 commit 0cc7bb7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions graphene/utils/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ def deprecated(reason):
# @deprecated("please, use another function")
# def old_function(x, y):
# pass
reason = reason.decode() if isinstance(reason, bytes) else reason

def decorator(func1):
if inspect.isclass(func1):
fmt1 = f"Call to deprecated class {func1.__name__} ({reason.decode()})."
fmt1 = f"Call to deprecated class {func1.__name__} ({reason})."
else:
fmt1 = f"Call to deprecated function {func1.__name__} ({reason.decode()})."
fmt1 = f"Call to deprecated function {func1.__name__} ({reason})."

@functools.wraps(func1)
def new_func1(*args, **kwargs):
Expand Down

0 comments on commit 0cc7bb7

Please sign in to comment.