changeset 5407:a88ddb0f486b

merged moin/1.8
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 09 Jan 2010 02:41:22 +0100
parents a1a1ce8894cb (current diff) 0dd02729b3b5 (diff)
children 4226fde63931 c3822eacfe4a
files
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/SubProcess.py	Fri Jan 08 18:26:38 2010 +0100
+++ b/MoinMoin/util/SubProcess.py	Sat Jan 09 02:41:22 2010 +0100
@@ -8,7 +8,6 @@
 """
 
 import os
-import time
 import subprocess
 import threading
 import signal
@@ -22,6 +21,7 @@
         from win32process import TerminateProcess
 else:
     import select
+    import errno
 
 class Popen(subprocess.Popen):
     # send_signal, terminate, kill copied from Python 2.6
@@ -67,8 +67,6 @@
 
         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:
@@ -113,9 +111,9 @@
                 self.stdin.close()
 
             if self.stdout:
-                stdout_thread.join(self.timeout)
+                stdout_thread.join(timeout)
             if self.stderr:
-                stderr_thread.join(self.timeout)
+                stderr_thread.join(timeout)
 
             # if the threads are still alive, that means the thread join timed out
             timed_out = (self.stdout and stdout_thread.isAlive() or
@@ -169,7 +167,7 @@
             input_offset = 0
             while read_set or write_set:
                 try:
-                    rlist, wlist, xlist = select.select(read_set, write_set, [], self.timeout)
+                    rlist, wlist, xlist = select.select(read_set, write_set, [], timeout)
                 except select.error, e:
                     if e.args[0] == errno.EINTR:
                         continue