Explorar el Código

Catch ZeroDivisionError in 'Average file size'.

Heikki Hokkanen hace 13 años
padre
commit
75b53209da
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4
    1
      gitstats

+ 4
- 1
gitstats Ver fichero

@@ -1019,7 +1019,10 @@ class HTMLReportCreator(ReportCreator):
1019 1019
 		f.write('<dl>\n')
1020 1020
 		f.write('<dt>Total files</dt><dd>%d</dd>' % data.getTotalFiles())
1021 1021
 		f.write('<dt>Total lines</dt><dd>%d</dd>' % data.getTotalLOC())
1022
-		f.write('<dt>Average file size</dt><dd>%.2f bytes</dd>' % (float(data.getTotalSize()) / data.getTotalFiles()))
1022
+		try:
1023
+			f.write('<dt>Average file size</dt><dd>%.2f bytes</dd>' % (float(data.getTotalSize()) / data.getTotalFiles()))
1024
+		except ZeroDivisionError:
1025
+			pass
1023 1026
 		f.write('</dl>\n')
1024 1027
 
1025 1028
 		# Files :: File count by date