changeset 5505:fb28b058a4f6

partially revert 0dd02729b3b5 (self.timeout related changes caused AttributeError)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 19 Jan 2010 23:59:37 +0100
parents 7c3159dd7f53
children a4b4cd17410c
files MoinMoin/util/SubProcess.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/SubProcess.py	Fri Feb 05 18:33:35 2010 +0100
+++ b/MoinMoin/util/SubProcess.py	Tue Jan 19 23:59:37 2010 +0100
@@ -67,6 +67,8 @@
 
         communicate() returns a tuple (stdout, stderr)."""
 
+        self.timeout = timeout
+
         # Optimization: If we are only using one pipe, or no pipe at
         # all, using select() or threads is unnecessary.
         if [self.stdin, self.stdout, self.stderr].count(None) >= 2:
@@ -111,9 +113,9 @@
                 self.stdin.close()
 
             if self.stdout:
-                stdout_thread.join(timeout)
+                stdout_thread.join(self.timeout)
             if self.stderr:
-                stderr_thread.join(timeout)
+                stderr_thread.join(self.timeout)
 
             # if the threads are still alive, that means the thread join timed out
             timed_out = (self.stdout and stdout_thread.isAlive() or
@@ -167,7 +169,7 @@
             input_offset = 0
             while read_set or write_set:
                 try:
-                    rlist, wlist, xlist = select.select(read_set, write_set, [], timeout)
+                    rlist, wlist, xlist = select.select(read_set, write_set, [], self.timeout)
                 except select.error, e:
                     if e.args[0] == errno.EINTR:
                         continue