~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

Fix 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