Skip to content

Commit b877aec

Browse files
committed
Avoid triggering node state errors during lockfile id validation
1 parent e0b7e75 commit b877aec

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/_pytask/lockfile.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,14 @@ def _raise_error_if_lockfile_ids_are_ambiguous(tasks: list[PTask], root: Path) -
276276
)
277277

278278
for kind, node in chain(dependencies, products):
279-
if node.state() is None:
279+
try:
280+
node_state = node.state()
281+
except Exception: # noqa: BLE001
282+
# Preserve existing behavior where state() errors are raised during
283+
# task execution, not during collection-time lockfile validation.
284+
node_state = None
285+
286+
if node_state is None:
280287
continue
281288

282289
node_id = build_portable_node_id(node, root)

0 commit comments

Comments
 (0)