bisect-kit: fix exception in 'view' command output
BUG=None
TEST=unittest
Change-Id: I53e887ac71a64f1f9e314fe3b5f776fb752f8f4f
Reviewed-on: https://chromium-review.googlesource.com/1420422
Commit-Ready: Kuang-che Wu <kcwu@chromium.org>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Chi-Ngai Wan <cnwan@google.com>
diff --git a/bisect_kit/cli.py b/bisect_kit/cli.py
index 6a450e5..3133b9a 100644
--- a/bisect_kit/cli.py
+++ b/bisect_kit/cli.py
@@ -541,7 +541,7 @@
print(link['note'])
print('Range: (%s, %s], %s revs left' % (old, new, (new_idx - old_idx)))
- if 'remaining_steps' in summary:
+ if summary.get('remaining_steps'):
print('(roughly %d steps)' % summary['remaining_steps'])
for i, rev_info in enumerate(summary['rev_info']):
@@ -551,7 +551,7 @@
detail = []
if self.strategy.is_noisy():
- detail.append('%.4f%%' % summary['prob'][i] * 100)
+ detail.append('%.4f%%' % (summary['prob'][i] * 100))
if rev_info['result_counter']:
detail.append(str(rev_info['result_counter']))
values = sorted(rev_info['values'])