Skip to contentSkip to conversation

buildhistory_analysis: fix broken list length checks

PATCH New Paul Eggleton 1 participant 1 message Dec 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildhistory_analysis: fix broken list length checks

Fix erroneous use of .count instead of len(), which unfortunately is not reported by Python as an error in a numeric comparison.

---
 meta/lib/oe/buildhistory_analysis.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oe/buildhistory_analysis.py +2 -2
index ad57f00..7b5ee45 100644
@@ -185,7 +185,7 @@ def blob_to_dict(blob):
     adict = {}
     for line in alines:
         splitv = [i.strip() for i in line.split('=',1)]
-        if splitv.count > 1:
+        if len(splitv) > 1:
             adict[splitv[0]] = splitv[1]
     return adict
 
@@ -231,7 +231,7 @@ def compare_file_lists(alines, blines):
                 filechanges.append(FileChange(path, FileChange.changetype_ownergroup, oldvalue, newvalue))
             # Check symlink target
             if newsplitv[0][0] == 'l':
-                if splitv.count > 3:
+                if len(splitv) > 3:
                     oldvalue = splitv[3]
                 else:
                     oldvalue = None
Signature · 1 line
1.7.10.4