From 1bc1fc2117d13f59202a90d6c246bca98d723d12 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 18 Sep 2018 05:02:38 -0700 Subject: [PATCH] add constructor arguments for TimeoutExpired (#2466) Previously, constructing a TimeoutExpired directly worked because Exception allowed arbitrary kwargs. We fixed that recently, but now mypy gives an error on creating a TimeoutExpired with legal arguments. --- stdlib/3/subprocess.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/3/subprocess.pyi b/stdlib/3/subprocess.pyi index 8beba00cd..d245440d3 100644 --- a/stdlib/3/subprocess.pyi +++ b/stdlib/3/subprocess.pyi @@ -209,6 +209,7 @@ STDOUT = ... # type: int DEVNULL = ... # type: int class SubprocessError(Exception): ... class TimeoutExpired(SubprocessError): + def __init__(self, cmd: _CMD, timeout: float, output: Optional[_TXT] = ..., stderr: Optional[_TXT] = ...) -> None: ... # morally: _CMD cmd = ... # type: Any timeout = ... # type: float