All pastes #443600 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-16 21:52 UTC
rendered paste body
Index: C:/cygwin/home/heikki/workspace/chandler/tools/killableprocess.py
===================================================================
--- C:/cygwin/home/heikki/workspace/chandler/tools/killableprocess.py	(revision 13973)
+++ C:/cygwin/home/heikki/workspace/chandler/tools/killableprocess.py	(working copy)
@@ -157,7 +157,12 @@
                 winprocess.TerminateProcess(self._handle, 127)
             self.returncode = 127    
         else:
-            if group:
+            if sys.platform == 'cygwin':
+                cmd = "taskkill /f /pid " + str(self.pid)
+                if group:
+                    cmd += " /t"
+                os.system(cmd)
+            elif group:
                 os.killpg(self.pid, signal.SIGKILL)
             else:
                 os.kill(self.pid, signal.SIGKILL)