Allow using spin() from ProcessLogger even with no logger given.
--- a/util/ProcessLogger.py Wed Mar 10 09:59:18 2021 +0100
+++ b/util/ProcessLogger.py Tue Mar 23 05:08:51 2021 +0100
@@ -239,11 +239,14 @@
def spin(self):
start = time.time()
- while not self.finishsem.acquire(0):
- with self.spinwakeuplock:
- self.spinwakeuptimer = Timer(0.1, self.spinwakeup)
- self.spinwakeuptimer.start()
- self.spinwakeupcond.wait()
- self.logger.progress("%.3fs"%(time.time() - start))
+ if self.logger:
+ while not self.finishsem.acquire(0):
+ with self.spinwakeuplock:
+ self.spinwakeuptimer = Timer(0.1, self.spinwakeup)
+ self.spinwakeuptimer.start()
+ self.spinwakeupcond.wait()
+ self.logger.progress("%.3fs"%(time.time() - start))
+ else:
+ self.finishsem.acquire()
return [self.exitcode, "".join(self.outdata), "".join(self.errdata)]