Refactor kill_after_timeout logic so mypy can check it · gitpython-developers/GitPython@4191f7d · GitHub
Skip to content

Commit 4191f7d

Browse files
committed
Refactor kill_after_timeout logic so mypy can check it
This changes how Git.execute defines the kill_process callback and how it performs checks, fixing two mypy errors on Windows about how the signal module doesn't have SIGKILL. In doing so, it also eliminates the need for the assertion added for safety and clarity in 2f017ac (#1761), since now kill_process is only defined if it is to be used (which is also guarded by a platform check, needed by mypy). As in dc95a76 before this, part of the change here is to replace some os.named-based checks with sys.platform-based checks, which is safe because, when one is specifically checking only for the distinction between native Windows and all other systems, one can use either approach. (See dc95a76 for more details on that.)
1 parent dc95a76 commit 4191f7d

1 file changed

Lines changed: 35 additions & 32 deletions

File tree

git/cmd.py

Lines changed: 35 additions & 32 deletions

0 commit comments

Comments
 (0)