summaryrefslogtreecommitdiffstats
path: root/stats.py
diff options
context:
space:
mode:
Diffstat (limited to 'stats.py')
-rw-r--r--stats.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/stats.py b/stats.py
index 6216f44..d61be6f 100644
--- a/stats.py
+++ b/stats.py
@@ -24,7 +24,10 @@ def stats(stream):
24 min_inversion = length 24 min_inversion = length
25 sum_inversions += length 25 sum_inversions += length
26 yield record 26 yield record
27 avg_inversion = int(sum_inversions / num_inversions) 27 if num_inversions > 0:
28 avg_inversion = int(sum_inversions / num_inversions)
29 else:
30 avg_inversion = 0
28 class Obj(): pass 31 class Obj(): pass
29 rec = Obj() 32 rec = Obj()
30 rec.record_type = "meta" 33 rec.record_type = "meta"