Flush all subprocess output before exit

Subprocesses write to stdout. They must flush their output before the
main process exits to avoid losing output or confusing the calling
program.
This commit is contained in:
Weeble 2014-10-19 18:06:19 +01:00
parent 26f909b282
commit 6e08711622

View file

@ -74,6 +74,9 @@ class BaseQReport(pep8.BaseReport):
except KeyboardInterrupt:
pass
finally:
# ensure all output is flushed before main process continues
sys.stdout.flush()
sys.stderr.flush()
self.result_queue.put(self.get_state())
def get_state(self):