~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-03-10 00:26:57 UTC
  • mfrom: (1551.2.35 Aaron's small fixes)
  • Revision ID: pqm@pqm.ubuntu.com-20060310002657-2884f3b271336e36
Stop division by zero

Show diffs side-by-side

added added

removed removed

Lines of Context:
265
265
                    self.child_fraction)
266
266
 
267
267
    def child_update(self, message, current, total):
268
 
        if current is not None:
 
268
        if current is not None and total != 0:
269
269
            child_fraction = float(current) / total
270
270
            if self.last_cnt is None:
271
271
                pass
382
382
        self.tick()
383
383
 
384
384
    def child_update(self, message, current, total):
385
 
        if current is None:
 
385
        if current is None or total == 0:
386
386
            self.child_fraction = 0
387
387
        else:
388
388
            self.child_fraction = float(current) / total