Skip to content

Commit c459507

Browse files
committed
fix: incorrect task names with __main__
1 parent 1f2e24e commit c459507

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

taskiq/abc/broker.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,10 @@ def inner(
318318
fmodule = func.__module__
319319
if fmodule == "__main__": # pragma: no cover
320320
fmodule = ".".join(
321-
remove_suffix(sys.argv[0], ".py").split(
322-
os.path.sep,
323-
),
321+
remove_suffix(
322+
os.path.normpath(sys.argv[0]),
323+
".py",
324+
).split(os.path.sep),
324325
)
325326
fname = func.__name__
326327
if fname == "<lambda>":

0 commit comments

Comments
 (0)