Skip to content

Commit b77bbef

Browse files
xuyucaiclaude
andcommitted
fix: correct operator precedence in install command validation
Fixed issue #335: --pr cannot be used with --version or --commit The condition "pr and version not in {None, \"nightly\"} or commit" was evaluated incorrectly due to operator precedence. Added parentheses to ensure the logic only triggers error when --pr is actually combined with conflicting flags, not when only --commit is specified. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent fbaf5e9 commit b77bbef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

comfy_cli/cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def install(
325325
)
326326
raise typer.Exit(code=1)
327327

328-
if pr and version not in {None, "nightly"} or commit:
328+
if pr and (version not in {None, "nightly"} or commit):
329329
rprint("--pr cannot be used with --version or --commit")
330330
raise typer.Exit(code=1)
331331

0 commit comments

Comments
 (0)