From 583b5fa75362afc4b1193a45e34b2ce979a01896 Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Fri, 25 Sep 2015 23:52:53 +0200 Subject: [PATCH] Python 3 compatibility was broken with commit aeb9ad6 (Fixes #70). --- gitinspector/changes.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gitinspector/changes.py b/gitinspector/changes.py index 1dedccc..f4ddaf8 100644 --- a/gitinspector/changes.py +++ b/gitinspector/changes.py @@ -173,7 +173,7 @@ class ChangesThread(threading.Thread): filediff = FileDiff(j) commit.add_filediff(filediff) - self.changes.commits[self.offset / CHANGES_PER_THREAD] = commits + self.changes.commits[self.offset // CHANGES_PER_THREAD] = commits __changes_lock__.release() # ...to here. __thread_lock__.release() # Lock controlling the number of threads running @@ -190,16 +190,18 @@ class Changes: stdout=subprocess.PIPE).stdout lines = git_log_hashes_r.readlines() git_log_hashes_r.close() - self.commits = [None] * (len(lines) / CHANGES_PER_THREAD + 1) + self.commits = [None] * (len(lines) // CHANGES_PER_THREAD + 1) first_hash = "" for i, entry in enumerate(lines): if i % CHANGES_PER_THREAD == CHANGES_PER_THREAD - 1: - second_hash = entry.strip() + entry = entry.decode("utf-8", "replace").strip() + second_hash = entry ChangesThread.create(hard, self, first_hash, second_hash, i) - first_hash = entry.strip() + ".." + first_hash = entry + ".." else: - second_hash = entry.strip() + entry = entry.decode("utf-8", "replace").strip() + second_hash = entry ChangesThread.create(hard, self, first_hash, second_hash, i) # Make sure all threads have completed.