Try to fix strange wxPopen behavior. Feedback appreciated.
authoretisserant
Mon, 23 Jun 2008 16:06:20 +0200
changeset 162 bf3eac08a96b
parent 161 faad68924b53
child 163 482ca562d414
Try to fix strange wxPopen behavior. Feedback appreciated.
wxPopen.py
--- a/wxPopen.py	Wed Jun 04 17:47:54 2008 +0200
+++ b/wxPopen.py	Mon Jun 23 16:06:20 2008 +0200
@@ -46,14 +46,17 @@
         self.fd = fd
 
     def run(self):
+        outchunk = None
         self.retval = None
+        while outchunk != '' and not self.killed :
+            outchunk = self.fd.readline()
+            if self.callback : self.callback(outchunk)
         while self.retval is None and not self.killed :
             self.retval = self.Proc.poll()
             outchunk = self.fd.readline()
-            #if outchunk == '':
-            #    break
-            if self.callback :
-                self.callback(outchunk)
+            if self.callback : self.callback(outchunk)
+        while outchunk != '' and not self.killed :
+            outchunk = self.fd.readline()
         if self.endcallback:
             try:
             	err = self.Proc.wait()