| OLD | NEW |
| 1 #!/usr/bin/python | |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 5 | 4 |
| 6 """Generic utilities for all python scripts.""" | 5 """Generic utilities for all python scripts.""" |
| 7 | 6 |
| 8 import os | 7 import os |
| 9 import signal | 8 import signal |
| 10 import subprocess | 9 import subprocess |
| 11 import sys | 10 import sys |
| (...skipping 27 matching lines...) Expand all Loading... |
| 39 def IsMac(): | 38 def IsMac(): |
| 40 return sys.platform.startswith('darwin') | 39 return sys.platform.startswith('darwin') |
| 41 | 40 |
| 42 | 41 |
| 43 def Kill(pid): | 42 def Kill(pid): |
| 44 """Terminate the given pid.""" | 43 """Terminate the given pid.""" |
| 45 if IsWin(): | 44 if IsWin(): |
| 46 subprocess.call(['taskkill.exe', '/T', '/F', '/PID', str(pid)]) | 45 subprocess.call(['taskkill.exe', '/T', '/F', '/PID', str(pid)]) |
| 47 else: | 46 else: |
| 48 os.kill(pid, signal.SIGTERM) | 47 os.kill(pid, signal.SIGTERM) |
| OLD | NEW |