From 30b22aaddd271d8dd863546e379bcb7cc9d64b0b Mon Sep 17 00:00:00 2001 From: Eric Gerlach Date: Thu, 8 Feb 2024 03:21:04 -0500 Subject: [PATCH] Fix path in "Node is dir" error message The error message currently displays the path to the source file of the task. This fixes it to be the path of the node being considered. --- src/_pytask/collect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytask/collect.py b/src/_pytask/collect.py index afa1c9bc..bb0f2d95 100644 --- a/src/_pytask/collect.py +++ b/src/_pytask/collect.py @@ -444,7 +444,7 @@ def pytask_collect_node(session: Session, path: Path, node_info: NodeInfo) -> PN name = shorten_path(node, session.config["paths"] or (session.config["root"],)) if isinstance(node, Path) and node.is_dir(): - raise ValueError(_TEMPLATE_ERROR_DIRECTORY.format(path=path)) + raise ValueError(_TEMPLATE_ERROR_DIRECTORY.format(path=node)) return PathNode(name=name, path=node)