diff --git a/taskiq/abc/broker.py b/taskiq/abc/broker.py index fd03e3ad..c0902371 100644 --- a/taskiq/abc/broker.py +++ b/taskiq/abc/broker.py @@ -29,7 +29,7 @@ from taskiq.result_backends.dummy import DummyResultBackend from taskiq.serializers.json_serializer import JSONSerializer from taskiq.state import TaskiqState -from taskiq.utils import maybe_awaitable, remove_suffix +from taskiq.utils import maybe_awaitable from taskiq.warnings import TaskiqDeprecationWarning if sys.version_info >= (3, 11): @@ -317,10 +317,9 @@ def inner( fmodule = func.__module__ if fmodule == "__main__": # pragma: no cover fmodule = ".".join( - remove_suffix( - os.path.normpath(sys.argv[0]), - ".py", - ).split(os.path.sep), + os.path.normpath(sys.argv[0]) + .removesuffix(".py") + .split(os.path.sep), ) fname = func.__name__ if fname == "": diff --git a/taskiq/utils.py b/taskiq/utils.py index 3a9867ca..725adc1f 100644 --- a/taskiq/utils.py +++ b/taskiq/utils.py @@ -29,16 +29,3 @@ async def maybe_awaitable( if inspect.isawaitable(possible_coroutine): return await possible_coroutine return possible_coroutine # type: ignore - - -def remove_suffix(text: str, suffix: str) -> str: - """ - Removing a Suffix from a String with a Custom Function. - - :param text: String - :param suffix: Removing a Suffix - :return: value. - """ - if text.endswith(suffix): - return text[: -len(suffix)] - return text