Clarify some Git.execute kill_after_timeout limitations by EliahKagan · Pull Request #1761 · gitpython-developers/GitPython (original) (raw)
This makes the two preliminary changes discussed as possibly useful in #1756 (comment):
See discussion in #1756. However, I do not assum based on what has been discussed there that these specific changes are necessarily ideal, and I'd be pleased to make changes on request.
I considered adding a test but decided not to, based in part on the point about tests in #1756 (comment), and in part on the limited nature of the changes. However, I did do the following to check that it still seems to work:
>>> git.Git().execute(['sleep', '10'], kill_after_timeout=5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/workspaces/GitPython/git/cmd.py", line 1111, in execute
raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('sleep') failed due to: exit code(-9)
cmdline: sleep 10
stderr: 'Timeout: the command "sleep 10" did not complete in 5 secs.'
>>> git.Git().execute(['sleep', '4'], kill_after_timeout=5)
''