From 43b7f8a3eb299c550674c6f95c9919019dc5a194 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Thu, 7 Mar 2024 10:31:31 -0500 Subject: [PATCH] Annotate safer_popen broad enough for all platforms This fixes another static typing error reported by mypy. (The annotation could be made more specific in the future by making a custom protocol for it, which may or may not be worthwhile, given that `**kwargs: Any` would still have to be present after whatever typed keyword arguments the protocol's `__call__` method listed, since some callers intentionally forward arbitrary extra keyword arguments through safer_popen to Popen.) --- git/cmd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git/cmd.py b/git/cmd.py index 6354da666..c37d28988 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -278,6 +278,8 @@ def _safer_popen_windows( ) +safer_popen: Callable[..., Popen] + if os.name == "nt": safer_popen = _safer_popen_windows else: