From 012e90f26627fc9cfdfff3570d7eb92f550e054d Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Fri, 8 May 2020 12:53:32 -0700 Subject: [PATCH] dmypy: fix test failure on py39 There's a fun Python 3.9 only test case failure, where "Daemon started" is output after the error message from parsing options. I ended up needing to bisect to figure out why this consistently breaks on Python 3.9. The issue is caused by https://github.com/python/cpython/pull/17646/ (which fixes a surprisingly old BPO). --- mypy/dmypy/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mypy/dmypy/client.py b/mypy/dmypy/client.py index cf16cb270b01..80f03743086c 100644 --- a/mypy/dmypy/client.py +++ b/mypy/dmypy/client.py @@ -390,6 +390,7 @@ def check_output(response: Dict[str, Any], verbose: bool, except KeyError: fail("Response: %s" % str(response)) sys.stdout.write(out) + sys.stdout.flush() sys.stderr.write(err) if verbose: show_stats(response)