Skip to content

Commit b7a1980

Browse files
committed
check attr exists first
1 parent c325aec commit b7a1980

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)