From 6e087116227079770fc2653bb2d97bc3ccfff2ff Mon Sep 17 00:00:00 2001 From: Weeble Date: Sun, 19 Oct 2014 18:06:19 +0100 Subject: [PATCH] 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. --- flake8/reporter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake8/reporter.py b/flake8/reporter.py index 8306055..9a14602 100644 --- a/flake8/reporter.py +++ b/flake8/reporter.py @@ -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):