Prevent ZeroDivisionError in get_stability method (Fixes #63).

Signed-off-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
This commit is contained in:
Kamila Chyla 2015-04-15 08:50:12 +02:00 committed by Adam Waldenberg
parent 30a20e6b52
commit 96e2b0fdf0
1 changed files with 2 additions and 2 deletions

View File

@ -172,8 +172,8 @@ class Blame:
@staticmethod
def get_stability(author, blamed_rows, changes):
if author in changes.get_authorinfo_list():
return 100.0 * blamed_rows / changes.get_authorinfo_list()[author].insertions
author_insertions = changes.get_authorinfo_list()[author].insertions
return 100 if author_insertions == 0 else 100.0 * blamed_rows / author_insertions
return 100
@staticmethod