Skip to content

Commit

Permalink
Optimize the format of the code, check the list None before use
Browse files Browse the repository at this point in the history
Signed-off-by: lixintao <[email protected]>
  • Loading branch information
lixintao committed Jun 27, 2024
1 parent 867dc7a commit 794d389
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions avocado/core/nrunner/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def _setup_parser(self, prog, description):
def _get_commands_method(self):
prefix = "command_"
return {
c[0][len(prefix) :].replace("_", "-"): getattr(self, c[0])
c[0][len(prefix):].replace("_", "-"): getattr(self, c[0])
for c in inspect.getmembers(self, inspect.ismethod)
if c[0].startswith(prefix)
if c and c[0].startswith(prefix)
}

@staticmethod
Expand Down

0 comments on commit 794d389

Please sign in to comment.