summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgui.py5
-rw-r--r--iutil.py13
2 files changed, 16 insertions, 2 deletions
diff --git a/gui.py b/gui.py
index 671bb580a..4def03f59 100755
--- a/gui.py
+++ b/gui.py
@@ -521,7 +521,10 @@ class ProgressWindow:
return
self.progress.set_pulse_step(self.updpct)
self.lastUpdate = now
- # if we've had a largish gap, some smoothing does actually help.
+ # if we've had a largish gap, some smoothing does actually help,
+ # but don't go crazy
+ if delta > 2:
+ delta=2
while delta > 0:
self.progress.pulse()
processEvents()
diff --git a/iutil.py b/iutil.py
index 49509e993..ec25adba4 100644
--- a/iutil.py
+++ b/iutil.py
@@ -236,11 +236,22 @@ def execWithPulseProgress(command, argv, stdin = None, stdout = None,
runningLog.write(s)
if progress: progress.pulse()
+ # break out early if the sub-process changes status.
+ # no need to flush the stream if the process has exited
+ try:
+ (pid, status) = os.waitpid(childpid,os.WNOHANG)
+ if pid != 0:
+ break
+ except OSError as e:
+ log.critical("exception from waitpid: %s %s" %(e.errno, e.strerror))
+
if len(s) < 1:
break
try:
- (pid, status) = os.waitpid(childpid, 0)
+ #if we didn't already get our child's exit status above, do so now.
+ if not pid:
+ (pid, status) = os.waitpid(childpid, 0)
except OSError as e:
log.critical("exception from waitpid: %s %s" %(e.errno, e.strerror))