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
6
6
docstring_style =sphinx
7
7
8
8
ignore =
9
+ ; Found a line that starts with a dot
10
+ WPS348,
9
11
; `noqa` comments overuse ))))
10
12
WPS402,
11
13
; Found `%` string formatting
Original file line number Diff line number Diff line change 1
1
import inspect
2
+ import os
3
+ import sys
2
4
from abc import ABC , abstractmethod
3
5
from functools import wraps
4
6
from logging import getLogger
@@ -187,9 +189,18 @@ def inner(
187
189
) -> AsyncTaskiqDecoratedTask [_FuncParams , _ReturnType ]:
188
190
nonlocal inner_task_name # noqa: WPS420
189
191
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
193
204
wrapper = wraps (func )
194
205
195
206
decorated_task = wrapper (
You can’t perform that action at this time.
0 commit comments