Skip to content

fix: call callable action once per expand_action instead of multiple times - #487

Open
AruneshDwivedi wants to merge 1 commit into
pydoit:masterfrom
AruneshDwivedi:fix-cmdaction-callable
Open

fix: call callable action once per expand_action instead of multiple times#487
AruneshDwivedi wants to merge 1 commit into
pydoit:masterfrom
AruneshDwivedi:fix-cmdaction-callable

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

The action property on CmdAction invokes the callable on each access. Since expand_action() reads self.action up to three times, the callable was being executed up to three times per task run.

Fix: resolve the action to a local variable at the start of expand_action() and reuse it.

Fixes #437

…times

The action property invoked the callable on each access, so expand_action()
called it up to three times (no-task path, list check, string format path).
Cache the resolved value in a local variable to invoke it only once.

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
@AruneshDwivedi
AruneshDwivedi force-pushed the fix-cmdaction-callable branch from e9864c5 to 07b94f0 Compare August 1, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CmdAction calls callable more than once

1 participant