mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 02:46:52 +00:00
Merge branch 'flush_stdout' into 'master'
Flush stdout As noted in email, it seems that failing to flush stdout in the sub-processes means that some output might go missing. I've observed this in practice with Syntastic in Vim. Here I flush both stdout and stderr before sending the message back to the main process that will allow it to continue. This makes the problem disappear for me. It occurs to me that if sub-processes are producing output independently, there is also be a risk that they will badly interleave their output. I haven't looked into this - my primary concern is invocation for a single file at a time. See merge request !7
This commit is contained in:
commit
467233f185
1 changed files with 3 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue