Skip to content

Commit 30b22aa

Browse files
committed
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.
1 parent 7fa5e9a commit 30b22aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytask/collect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def pytask_collect_node(session: Session, path: Path, node_info: NodeInfo) -> PN
444444
name = shorten_path(node, session.config["paths"] or (session.config["root"],))
445445

446446
if isinstance(node, Path) and node.is_dir():
447-
raise ValueError(_TEMPLATE_ERROR_DIRECTORY.format(path=path))
447+
raise ValueError(_TEMPLATE_ERROR_DIRECTORY.format(path=node))
448448

449449
return PathNode(name=name, path=node)
450450

0 commit comments

Comments
 (0)