This fixes the following python lint warnings. usertools/dpdk-pmdinfo.py:188:11: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition) usertools/dpdk-pmdinfo.py:196:21: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition) usertools/dpdk-pmdinfo.py:302:11: C1801: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
Signed-off-by: Stephen Hemminger <step...@networkplumber.org> --- usertools/dpdk-pmdinfo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py index 1c2c3d05fea6..2bead75da238 100755 --- a/usertools/dpdk-pmdinfo.py +++ b/usertools/dpdk-pmdinfo.py @@ -185,7 +185,7 @@ def findDate(self, content): return None def parse(self): - if len(self.contents) < 1: + if not self.contents: print("data/%s-pci.ids not found" % self.date) else: vendorID = "" @@ -193,7 +193,7 @@ def parse(self): for l in self.contents: if l[0] == "#": continue - elif len(l.strip()) == 0: + elif not l.strip(): continue else: if l.find("\t\t") == 0: @@ -307,7 +307,7 @@ def parse_pmd_info_string(self, mystring): except KeyError: continue - if len(pmdinfo["pci_ids"]) != 0: + if pmdinfo["pci_ids"]: print("PMD HW SUPPORT:") if pcidb is not None: self.pretty_print_pmdinfo(pmdinfo) -- 2.27.0