summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-06-30 19:27:57 +0000
committerMatt Wilson <msw@redhat.com>2000-06-30 19:27:57 +0000
commit049036d086b6fedb37a523c9e961ea9f6152e605 (patch)
tree719c47ce1e1fbc9a9dfafe20ab035d7641bf6f0d
parent25b53ec4217d54ffc8627e896371eee438a0a005 (diff)
downloadanaconda-049036d086b6fedb37a523c9e961ea9f6152e605.tar.gz
anaconda-049036d086b6fedb37a523c9e961ea9f6152e605.tar.xz
anaconda-049036d086b6fedb37a523c9e961ea9f6152e605.zip
avoid div by 0
-rw-r--r--iw/progress_gui.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/iw/progress_gui.py b/iw/progress_gui.py
index ac34e1017..c228e0f7e 100644
--- a/iw/progress_gui.py
+++ b/iw/progress_gui.py
@@ -89,18 +89,19 @@ class InstallProgressWindow (InstallWindow):
def setPackage(self, header):
threads_enter ()
- if not (self.numComplete) % (self.numTotal / len(self.pixmaps)):
- if self.numComplete:
- num = self.numComplete * len(self.pixmaps) / self.numTotal
- else:
- num = 0
- im = self.ics.readPixmap (self.pixmaps[num])
- im.render ()
- pix = im.make_pixmap ()
- self.adbox.remove (self.adpix)
- self.adbox.add (pix)
- self.adpix = pix
- self.adbox.show_all()
+ if len(self.pixmaps):
+ if not (self.numComplete) % (self.numTotal / len(self.pixmaps)):
+ if self.numComplete:
+ num = self.numComplete * len(self.pixmaps) / self.numTotal
+ else:
+ num = 0
+ im = self.ics.readPixmap (self.pixmaps[num])
+ im.render ()
+ pix = im.make_pixmap ()
+ self.adbox.remove (self.adpix)
+ self.adbox.add (pix)
+ self.adpix = pix
+ self.adbox.show_all()
self.curPackage["package"].set_text ("%s-%s-%s" % (header[rpm.RPMTAG_NAME],
header[rpm.RPMTAG_VERSION],