Skip to content

Commit

Permalink
Merge pull request #159 from sqozz/devision_zero
Browse files Browse the repository at this point in the history
Fix division by zero
  • Loading branch information
JoeLametta authored Aug 2, 2017
2 parents af18471 + e84361b commit 3f248bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions whipper/program/cdparanoia.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,14 @@ def getTrackQuality(self):

# don't go over a 100%; we know cdparanoia reads each frame at least
# twice
return min(frames * 2.0 / reads, 1.0)
try:
return min(frames * 2.0 / reads, 1.0)
except ZeroDivisionError:
return 0


# FIXME: handle errors


class ReadTrackTask(task.Task):
"""
I am a task that reads a track using cdparanoia.
Expand Down

0 comments on commit 3f248bf

Please sign in to comment.