fix incorrect use of string identity tests
Strings should not use "is" to test equivalence as that is an object
identity test, not a string compare test. It happens to work most of
the time, but better to be correct.
BUG=None
TEST=precq passes
Change-Id: If983681e87cf261228a4454d9c4d0dcf7b49a330
Reviewed-on: https://chromium-review.googlesource.com/565840
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
diff --git a/scripts/gerrit.py b/scripts/gerrit.py
index 8cee1e7..8f23d50 100644
--- a/scripts/gerrit.py
+++ b/scripts/gerrit.py
@@ -112,7 +112,7 @@
if not cat in approvs:
# Ignore the extended categories in the summary view.
continue
- elif approvs[cat] is '':
+ elif approvs[cat] == '':
approvs[cat] = val
elif val < 0:
approvs[cat] = min(approvs[cat], val)
@@ -130,7 +130,7 @@
if show_approvals and not opts.verbose:
approvs = GetApprovalSummary(opts, cl)
for cat in GERRIT_SUMMARY_CATS:
- if approvs[cat] is '' or approvs[cat] == 0:
+ if approvs[cat] in ('', 0):
functor = lambda x: x
elif approvs[cat] < 0:
functor = red