From e7c01d1ea5b31a3950f95c8758b99750d0d85f38 Mon Sep 17 00:00:00 2001
From: Nikos Skalkotos <skalkoto@grnet.gr>
Date: Thu, 8 Mar 2012 18:51:55 +0200
Subject: [PATCH] Add an extra yield in progress_generator
This is needed to suppress the StopIteration exception
---
image_creator/disk.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/image_creator/disk.py b/image_creator/disk.py
index 0d30f96..6d0ad1f 100644
--- a/image_creator/disk.py
+++ b/image_creator/disk.py
@@ -128,6 +128,7 @@ def progress_generator(total):
if i < position:
continue
position = yield
+ yield #suppress the StopIteration exception
class DiskDevice(object):
@@ -175,8 +176,6 @@ class DiskDevice(object):
if self.progress_bar is None:
self.progress_bar = progress_generator(total)
self.progress_bar.next()
- if position == 1:
- return
self.progress_bar.send(position)
--
GitLab