Skip to content

Commit

Permalink
Annotate safer_popen broad enough for all platforms
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
EliahKagan committed Mar 7, 2024
1 parent 3c5ca52 commit 43b7f8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions git/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ def _safer_popen_windows(
)


safer_popen: Callable[..., Popen]

if os.name == "nt":
safer_popen = _safer_popen_windows
else:
Expand Down

0 comments on commit 43b7f8a

Please sign in to comment.