Project

General

Profile

« Previous | Next » 

Revision 1648

profiling.py ItersProfiler, exc.py ExPercentTracker: Only output fraction of rows with errors if self.iter_ct > 0, to avoid divide-by-zero error

View differences:

profiling.py
35 35
    
36 36
    def msg(self):
37 37
        msg = Profiler.msg(self)
38
        if self.iter_ct != None:
38
        if self.iter_ct != None and self.iter_ct > 0:
39 39
            msg += ('/'+format.int2str(self.iter_ct)+' '+self.iter_text+'(s) = '
40 40
            +format.to_si(float(dates.total_seconds(self.total))/self.iter_ct)
41 41
            +'s/'+self.iter_text)

Also available in: Unified diff