(self)
| 214 | # TODO(machenbach): Use base process start without shell once |
| 215 | # https://crbug.com/v8/8889 is resolved. |
| 216 | def _start_process(self): |
| 217 | def wrapped(arg): |
| 218 | if set('() \'"') & set(arg): |
| 219 | return "'%s'" % arg.replace("'", "'\"'\"'") |
| 220 | return arg |
| 221 | try: |
| 222 | return subprocess.Popen( |
| 223 | args=' '.join(map(wrapped, self._get_popen_args())), |
| 224 | stdout=subprocess.PIPE, |
| 225 | stderr=subprocess.PIPE, |
| 226 | env=self._get_env(), |
| 227 | shell=True, |
| 228 | # Make the new shell create its own process group. This allows to kill |
| 229 | # all spawned processes reliably (https://crbug.com/v8/8292). |
| 230 | preexec_fn=os.setsid, |
| 231 | ) |
| 232 | except Exception as e: |
| 233 | sys.stderr.write('Error executing: %s\n' % self) |
| 234 | raise e |
| 235 | |
| 236 | def _kill_process(self, process): |
| 237 | # Kill the whole process group (PID == GPID after setsid). |
nothing calls this directly
no test coverage detected