Skip to content

Commit 475bad5

Browse files
committed
Fix.
1 parent 20cf973 commit 475bad5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytask/execute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def pytask_execute_build(session: Session) -> bool | None:
104104
def pytask_execute_task_protocol(session: Session, task: PTask) -> ExecutionReport:
105105
"""Follow the protocol to execute each task."""
106106
# Initialize explanation for this task if in explain mode
107-
if session.config.get("explain", False):
107+
if session.config["explain"]:
108108
task.attributes["explanation"] = TaskExplanation(reasons=[])
109109

110110
session.hook.pytask_execute_task_log_start(session=session, task=task)
@@ -136,7 +136,7 @@ def pytask_execute_task_setup(session: Session, task: PTask) -> None: # noqa: C
136136
"""
137137
if has_mark(task, "would_be_executed"):
138138
# Add cascade reason if in explain mode
139-
if session.config.get("explain", False) and "explanation" in task.attributes:
139+
if session.config["explain"] and "explanation" in task.attributes:
140140
marks = [m for m in task.markers if m.name == "would_be_executed"]
141141
if marks:
142142
preceding_task_name = marks[0].kwargs.get("task_name", "unknown")

0 commit comments

Comments
 (0)