From 98e27f513dd2bb1846f9c18f07134b44e023f42f Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Fri, 19 Jun 2020 21:48:00 +0300 Subject: [PATCH] Fix 'reviewers' command to make with Python3 Change-Id: I9716ed3f629d54f1a4e82dc64bf65a0702af6a25 --- reviewstats/cmd/reviewers.py | 2 +- reviewstats/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reviewstats/cmd/reviewers.py b/reviewstats/cmd/reviewers.py index b230cf7..34fc6f1 100755 --- a/reviewstats/cmd/reviewers.py +++ b/reviewstats/cmd/reviewers.py @@ -337,7 +337,7 @@ def main(argv=None): elif change['status'] == 'WORKINPROGRESS': change_stats['wip'] += 1 - reviewers = [(v, k) for k, v in reviewers.iteritems() + reviewers = [(v, k) for k, v in reviewers.items() if k.lower() not in ('jenkins', 'smokestack')] reviewers.sort(reverse=True, key=lambda r: r[0]['total']) # Do logical processing of reviewers. diff --git a/reviewstats/utils.py b/reviewstats/utils.py index 633cb15..71831e1 100644 --- a/reviewstats/utils.py +++ b/reviewstats/utils.py @@ -53,7 +53,7 @@ def get_remote_data(address, datatype='json'): raise DataRetrievalFailed(msg) data = "" while True: - chunk = remote_data.read() + chunk = remote_data.read().decode('utf-8') if not chunk: break data += chunk @@ -306,7 +306,7 @@ def get_changes(projects, ssh_user, ssh_key, only_open=False, stable='', # for the sake of not having to change all the code that calls this # function (yet, anyway). - all_changes = [value for value in all_changes.itervalues()] + all_changes = [value for value in all_changes.values()] return all_changes