pywbem/0002-coverity-deadcode.patch
Tony Asleson 5a021439fa Update to 0.17.6
Signed-off-by: Tony Asleson <tasleson@redhat.com>
2022-04-14 08:55:31 -05:00

16 lines
752 B
Diff

diff --git a/pywbem/_recorder.py b/pywbem/_recorder.py
index f5b2b7d6..70de34fe 100644
--- a/pywbem/_recorder.py
+++ b/pywbem/_recorder.py
@@ -689,8 +689,8 @@ class LogOperationRecorder(BaseOperationRecorder):
# 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"