# HG changeset patch # User Doug Simon # Date 1400234806 -7200 # Node ID 16059f6f56617bb3d3228afda813a9dc9d560b47 # Parent 98423229008c43d0a0866efd841e9b4d7a257a41 mx: drain *all* output from subprocess if redirecting to functions diff -r 98423229008c -r 16059f6f5661 mxtool/mx.py --- 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)