From 3194411594f86b3d02ea205ab74eb6f79f1779bd Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:27:41 -0800 Subject: [PATCH] Don't swallow stderr output cc @jorenham I was looking into https://github.com/python/mypy/pull/18756#issuecomment-2702314731 It looks like the pre-release version of mypy crashes (for some reason related to property changes, will investigate). Crash logs are emitted to stderr and process exits with exit code 2. This code does correctly chain the exit code, but swallows stderr. --- tool/stubtest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tool/stubtest.py b/tool/stubtest.py index 8dd24e35..3f92adde 100644 --- a/tool/stubtest.py +++ b/tool/stubtest.py @@ -128,6 +128,7 @@ def main() -> int: capture_output=True, env={"FORCE_COLOR": "1"} | os.environ, ) + sys.stderr.buffer.write(result.stderr) output = _rewrite_mypy_output(result.stdout) sys.stdout.buffer.write(output) sys.stdout.buffer.flush()