From b33aa4babf969abc5cb62d793c151c6cc8c6d031 Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Tue, 5 Dec 2023 13:01:36 -0900 Subject: [PATCH] fixup: use Path, not str for path of task --- src/_pytask/task_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytask/task_utils.py b/src/_pytask/task_utils.py index 0359084e..53659a3f 100644 --- a/src/_pytask/task_utils.py +++ b/src/_pytask/task_utils.py @@ -121,7 +121,8 @@ def wrapper(func: Callable[..., Any]) -> Callable[..., Any]: # Based on https://stackoverflow.com/questions/1095543/get-name-of-calling-functions-module-in-python # noqa: E501 frm = inspect.stack()[1] task_module = inspect.getmodule(frm.frame) - COLLECTED_TASKS[task_module.__file__].append(unwrapped) + task_path = Path(task_module.__file__) + COLLECTED_TASKS[task_path].append(unwrapped) return unwrapped