Skip to content

Commit bdef272

Browse files
committed
Fix "== None" and "!= None"
1 parent c64974b commit bdef272

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/cmpcodesize/cmpcodesize/compare.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343

4444
def addFunction(sizes, function, startAddr, endAddr, groupByPrefix):
45-
if not function or startAddr == None or endAddr == None:
45+
if not function or startAddr is None or endAddr is None:
4646
return
4747

4848
size = endAddr - startAddr
@@ -113,7 +113,7 @@ def readSizes(sizes, fileName, functionDetails, groupByPrefix):
113113
asmlineMatch = asmlinePattern.match(line)
114114
if asmlineMatch:
115115
addr = int(asmlineMatch.group(1), 16)
116-
if startAddr == None:
116+
if startAddr is None:
117117
startAddr = addr
118118
endAddr = addr
119119
elif line == "Section":
@@ -142,7 +142,7 @@ def readSizes(sizes, fileName, functionDetails, groupByPrefix):
142142
def compareSizes(oldSizes, newSizes, nameKey, title):
143143
oldSize = oldSizes[nameKey]
144144
newSize = newSizes[nameKey]
145-
if oldSize != None and newSize != None:
145+
if oldSize is not None and newSize is not None:
146146
if oldSize != 0:
147147
perc = "%.1f%%" % ((1.0 - float(newSize) / float(oldSize)) * 100.0)
148148
else:

0 commit comments

Comments
 (0)