File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ extend-ignore = E203
66docstring_style =sphinx
77
88ignore =
9+ ; Found a line that starts with a dot
10+ WPS348,
911 ; `noqa` comments overuse ))))
1012 WPS402,
1113 ; Found `%` string formatting
Original file line number Diff line number Diff line change 11import inspect
2+ import os
3+ import sys
24from abc import ABC , abstractmethod
35from functools import wraps
46from logging import getLogger
@@ -187,9 +189,18 @@ def inner(
187189 ) -> AsyncTaskiqDecoratedTask [_FuncParams , _ReturnType ]:
188190 nonlocal inner_task_name # noqa: WPS420
189191 if inner_task_name is None :
190- inner_task_name = ( # noqa: WPS442
191- f"{ func .__module__ } :{ func .__name__ } "
192- )
192+ fmodule = func .__module__
193+ if fmodule == "__main__" :
194+ fmodule = "." .join ( # noqa: WPS220
195+ sys .argv [0 ]
196+ .removesuffix (
197+ ".py" ,
198+ )
199+ .split (
200+ os .path .sep ,
201+ ),
202+ )
203+ inner_task_name = f"{ fmodule } :{ func .__name__ } " # noqa: WPS442
193204 wrapper = wraps (func )
194205
195206 decorated_task = wrapper (
You can’t perform that action at this time.
0 commit comments