Skip to content

Commit

Permalink
Coverity: DEADCODE correction
Browse files Browse the repository at this point in the history
pywbem/_recorder.py:693: dead_error_line: Execution cannot reach the expression """"
inside this statement: "ret_type = (ret ? type(ret[...".

Signed-off-by: Tony Asleson <tasleson@redhat.com>
  • Loading branch information
tasleson committed Apr 4, 2022
1 parent d7da740 commit 7f92db7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pywbem/_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,8 @@ def format_result(ret, max_len):
# Format the 'summary' and 'paths' detail_levels
if self.api_detail_level == 'summary': # pylint: disable=R1705
if isinstance(ret, list):
if ret:
ret_type = type(ret[0]).__name__ if ret else ""
if len(ret) > 0:
ret_type = type(ret[0]).__name__
return _format("list of {0}; count={1}",
ret_type, len(ret))
return "Empty"
Expand Down

0 comments on commit 7f92db7

Please sign in to comment.