fixed non-terminating process problem
authorEdouard Tisserant
Tue, 08 May 2012 17:48:47 +0200
changeset 723 cd5a51829416
parent 722 a94f361fc42e
child 724 e0630d262ac3
fixed non-terminating process problem
ProcessLogger.py
--- a/ProcessLogger.py	Tue May 08 17:16:37 2012 +0200
+++ b/ProcessLogger.py	Tue May 08 17:48:47 2012 +0200
@@ -131,7 +131,11 @@
                       self.errors)
         self.errt.start()
 
-        Timer(timeout,self.endlog).start()
+        if timeout:
+            self.timeout = Timer(timeout,self.endlog)
+            self.timeout.start()
+        else:
+            self.timeout = None
 
     def output(self,v):
         self.outdata.append(v)
@@ -154,6 +158,7 @@
         self.logger.write_warning(_("exited with status %s (pid %s)\n")%(str(ecode),str(pid)))
 
     def finish(self, pid,ecode):
+        if self.timeout: self.timeout.cancel()
         self.exitcode = ecode
         if self.exitcode != 0:
             self.log_the_end(ecode,pid)