Commits

Jun Omae committed 276db3d

1.0.2dev: ignore an `ESRCH` error while killing child process which has not been waited on Cygwin in `PyGIT.py`

Closes #10958.

Comments (0)

Files changed (1)

tracopt/versioncontrol/git/PyGIT.py

     def terminate_nix(process):
         import os
         import signal
-        return os.kill(process.pid, signal.SIGTERM)
+        try:
+            os.kill(process.pid, signal.SIGTERM)
+        except OSError, e:
+            # If the process has already finished and has not been
+            # waited for, killing it raises an ESRCH error on Cygwin
+            import errno
+            if e.errno != errno.ESRCH:
+                raise
 
     if sys.platform == 'win32':
         return terminate_win(process)