From 0cc7bb7748f9e0b9d53f1f1d051315bc3801db46 Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Sat, 6 Jul 2024 10:49:31 +0800 Subject: [PATCH] fix mypy error --- graphene/utils/deprecated.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graphene/utils/deprecated.py b/graphene/utils/deprecated.py index c51bd684..242a0c65 100644 --- a/graphene/utils/deprecated.py +++ b/graphene/utils/deprecated.py @@ -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):