diff options
author | Ashley Whetter <ashley.whetter@aardman.com> | 2015-12-21 10:48:58 +0000 |
---|---|---|
committer | Ashley Whetter <ashley.whetter@aardman.com> | 2015-12-21 10:48:58 +0000 |
commit | 05a302c962afbe5b54e207f557f0d3f77d040dc8 (patch) | |
tree | f8302a4bd0213f9acfb93a50fa9433403bbcbdba /git/cmd.py | |
parent | b295c13140f48e6a7125b4e4baf0a0ca03e1e393 (diff) | |
download | gitpython-05a302c962afbe5b54e207f557f0d3f77d040dc8.tar.gz |
Fixed a non-Windows import
signal.SIGKILL is not available on Windows so use signal.SIGTERM as a backup
when SIGKILL is not available.
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -14,7 +14,7 @@ import errno import mmap from contextlib import contextmanager -from signal import SIGKILL +import signal from subprocess import ( call, Popen, @@ -617,10 +617,12 @@ class Git(LazyMixin): if local_pid.isdigit(): child_pids.append(int(local_pid)) try: - os.kill(pid, SIGKILL) + # Windows does not have SIGKILL, so use SIGTERM instead + sig = getattr(signal, 'SIGKILL', signal.SIGTERM) + os.kill(pid, sig) for child_pid in child_pids: try: - os.kill(child_pid, SIGKILL) + os.kill(child_pid, sig) except OSError: pass kill_check.set() # tell the main routine that the process was killed |