summaryrefslogtreecommitdiffstats
path: root/support/scripts/graph-build-time
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2014-04-14 22:47:56 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-04-14 22:50:24 +0200
commita89f14e0f1c632393d4dc4bf4518de0b79976edc (patch)
treed04c5fceff16765f1ef825a1667d3609019300d7 /support/scripts/graph-build-time
parentc6f86d593c6875ab99057030a3b27c5490b8eac6 (diff)
downloadbuildroot-a89f14e0f1c632393d4dc4bf4518de0b79976edc.tar.gz
buildroot-a89f14e0f1c632393d4dc4bf4518de0b79976edc.zip
support/graphs: fix comparisons agains None
As Samuel said: In Python, None is a singleton, and it is recommended to use "is" or "is not" for testing them [1]. [1] http://legacy.python.org/dev/peps/pep-0008/#programming-recommendations Reported-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support/scripts/graph-build-time')
-rwxr-xr-xsupport/scripts/graph-build-time6
1 files changed, 3 insertions, 3 deletions
diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
index 45f94353f3..8ef065f127 100755
--- a/support/scripts/graph-build-time
+++ b/support/scripts/graph-build-time
@@ -84,7 +84,7 @@ class Package:
self.steps_duration[step] = self.steps_end[step] - self.steps_start[step]
def get_duration(self, step=None):
- if step == None:
+ if step is None:
duration = 0
for step in self.steps_duration.keys():
duration += self.steps_duration[step]
@@ -278,10 +278,10 @@ if args.alternate_colors:
else:
colors = default_colors
-if args.type == "histogram" or args.type == None:
+if args.type == "histogram" or args.type is None:
if args.order == "build" or args.order == "duration" or args.order == "name":
pkg_histogram(d, args.output, args.order)
- elif args.order == None:
+ elif args.order is None:
pkg_histogram(d, args.output, "name")
else:
sys.stderr.write("Unknown ordering: %s\n" % args.order)
OpenPOWER on IntegriCloud