mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #7403 (ZeroDivisionError: float division)
This commit is contained in:
parent
ddc8cde9e0
commit
e3fb323d86
@ -144,7 +144,10 @@ class DocAnalysis(object):
|
||||
|
||||
# Normalize the histogram into percents
|
||||
totalLines = len(self.lines)
|
||||
h = [ float(count)/totalLines for count in hRaw ]
|
||||
if totalLines > 0:
|
||||
h = [ float(count)/totalLines for count in hRaw ]
|
||||
else:
|
||||
h = []
|
||||
#print "\nhRaw histogram lengths are: "+str(hRaw)
|
||||
#print " percents are: "+str(h)+"\n"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user