Advertisement
3v1n0

Untitled

Jun 20th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.50 KB | None | 0 0
  1. --- a/Default/exec.py
  2. +++ b/Default/exec.py
  3. @@ -76,6 +76,7 @@
  4.                  stdin=subprocess.PIPE,
  5.                  startupinfo=startupinfo,
  6.                  env=proc_env,
  7. +                preexec_fn=os.setsid,
  8.                  shell=False)
  9.          elif shell_cmd and sys.platform == "linux":
  10.              # Explicitly use /bin/bash on Linux, to keep Linux and OSX as
  11. @@ -88,6 +89,7 @@
  12.                  stdin=subprocess.PIPE,
  13.                  startupinfo=startupinfo,
  14.                  env=proc_env,
  15. +                preexec_fn=os.setsid,
  16.                  shell=False)
  17.          else:
  18.              # Old style build system, just do what it asks
  19. @@ -98,6 +100,7 @@
  20.                  stdin=subprocess.PIPE,
  21.                  startupinfo=startupinfo,
  22.                  env=proc_env,
  23. +                preexec_fn=os.setsid,
  24.                  shell=shell)
  25.  
  26.          if path:
  27. @@ -111,7 +114,6 @@
  28.  
  29.      def kill(self):
  30.          if not self.killed:
  31. -            self.killed = True
  32.              if sys.platform == "win32":
  33.                  # terminate would not kill process opened by the shell cmd.exe,
  34.                  # it will only kill cmd.exe leaving the child running
  35. @@ -121,7 +123,9 @@
  36.                      "taskkill /PID " + str(self.proc.pid),
  37.                      startupinfo=startupinfo)
  38.              else:
  39. +                os.killpg(self.proc.pid, signal.SIGTERM)
  40.                  self.proc.terminate()
  41. +            self.killed = True
  42.              self.listener = None
  43.  
  44.      def poll(self):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement