changeset 15701:16059f6f5661

mx: drain *all* output from subprocess if redirecting to functions
author Doug Simon <doug.simon@oracle.com>
date Fri, 16 May 2014 12:06:46 +0200
parents 98423229008c
children c66c28e1f866
files mxtool/mx.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Fri May 16 00:12:48 2014 -0700
+++ b/mxtool/mx.py	Fri May 16 12:06:46 2014 +0200
@@ -1505,11 +1505,11 @@
         sub = _addSubprocess(p, args)
         if callable(out):
             t = Thread(target=redirect, args=(p.stdout, out))
-            t.daemon = True  # thread dies with the program
+            # Don't make the reader thread a daemon otherwise output can be droppped
             t.start()
         if callable(err):
             t = Thread(target=redirect, args=(p.stderr, err))
-            t.daemon = True  # thread dies with the program
+            # Don't make the reader thread a daemon otherwise output can be droppped
             t.start()
         if timeout is None or timeout == 0:
             retcode = waitOn(p)