From 33e1a34e3ccbb720455e11ec4f9199200db940f7 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Tue, 11 Oct 2022 21:20:44 -0700 Subject: [PATCH] subprocess: use narrower types for TimeoutExpired.std* (#8886) See https://github.com/python/cpython/pull/97685 The union type should be acceptable given https://github.com/python/cpython/issues/87597#issuecomment-1207402415. In general I'd like us to be able to type this, since these being bytes can be surprising if you pass text=True, but we'll see what mypy_primer says --- stdlib/subprocess.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index fded3f749..25b988adc 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -1828,8 +1828,8 @@ class TimeoutExpired(SubprocessError): timeout: float # morally: _TXT | None output: Any - stdout: Any - stderr: Any + stdout: bytes | None + stderr: bytes | None class CalledProcessError(SubprocessError): returncode: int