Changeset 3251

Show
Ignore:
Timestamp:
10/15/07 18:43:34 (17 years ago)
Author:
jerome
Message:

Fixed a problem with superfast servers :-)

Files:
1 modified

Legend:

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

    r3246 r3251  
    118118        after = time.time() 
    119119        if self.size : 
    120             speed = self.size / (after - self.before) 
     120            try : 
     121                speed = self.size / (after - self.before) 
     122            except ZeroDivisionError :     
     123                speed = 1 # Fake value in case of division by zero 
    121124            self.display("\r100.00%%\r        \r%s. %s : %.2f %s.\n" \ 
    122125                     % (_("Done"), _("Average speed"), speed, _("entries per second")))