diff mxtool/mx.py @ 4461:539fca6a3b98

Merge
author Christian Haeubl <christian.haeubl@oracle.com>
date Thu, 02 Feb 2012 16:07:52 -0800
parents 4023bae16d02
children 7903b6c28f9c
line wrap: on
line diff
--- a/mxtool/mx.py	Thu Feb 02 15:40:30 2012 -0800
+++ b/mxtool/mx.py	Thu Feb 02 16:07:52 2012 -0800
@@ -592,7 +592,14 @@
             # The preexec_fn=os.setsid
             p = subprocess.Popen(args, cwd=cwd, preexec_fn=preexec_fn, creationflags=creationflags)
             _currentSubprocess = (p, args)
-            retcode = p.wait()
+            if get_os() == 'windows':
+                # on windows use a poll loop, otherwise signal does not get handled
+                retcode = None
+                while retcode == None:
+                    retcode = p.poll()
+                    time.sleep(0.05)
+            else:
+                retcode = p.wait()            
         else:
             def redirect(stream, f):
                 for line in iter(stream.readline, ''):