Changeset 3271 for pykota/trunk

Show
Ignore:
Timestamp:
12/13/07 19:31:47 (17 years ago)
Author:
jerome
Message:

Works around a problem that can't be reproduced ! (Funny, isn't it ?)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r3260 r3271  
    117117        if self.size : 
    118118            try : 
    119                 speed = self.size / (after - self.before) 
     119                speed = self.size / ((after - self.before) + 0.00000000001) # adds an epsilon to avoir an user's problem I can't reproduce... 
    120120            except ZeroDivisionError :     
    121                 speed = 1 # Fake value in case of division by zero 
     121                speed = 1 # Fake value in case of division by zero, shouldn't happen anyway with the epsilon above... 
    122122            self.display("\r100.00%%\r        \r%s. %s : %.2f %s.\n" \ 
    123123                     % (_("Done"), _("Average speed"), speed, _("entries per second")))