Skip to content

Commit af58611

Browse files
authored
Merge pull request #552 from willcl-ark/commander-attr
check attr exists first in Commander help
2 parents 2e177a7 + b7a1980 commit af58611

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

resources/scenarios/commander.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def parse_args(self):
135135
help_parser = argparse.ArgumentParser(usage="%(prog)s [options]")
136136
self.add_options(help_parser)
137137
help_args, _ = help_parser.parse_known_args()
138-
if help_args.help:
138+
# Check if 'help' attribute exists in help_args before accessing it
139+
if hasattr(help_args, "help") and help_args.help:
139140
help_parser.print_help()
140141
sys.exit(0)
141142

0 commit comments

Comments
 (0)