(self)
| 270 | process.returncode = 0 |
| 271 | |
| 272 | def _start_process(self): |
| 273 | try: |
| 274 | return subprocess.Popen( |
| 275 | args=self._get_popen_args(), |
| 276 | stdout=subprocess.PIPE, |
| 277 | stderr=subprocess.PIPE, |
| 278 | env=self._get_env(), |
| 279 | shell=True, |
| 280 | # Make the new shell create its own process group. This allows to kill |
| 281 | # all spawned processes reliably (https://crbug.com/v8/8292). |
| 282 | preexec_fn=os.setsid, |
| 283 | ) |
| 284 | except Exception as e: |
| 285 | sys.stderr.write('Error executing: %s\n' % self) |
| 286 | raise e |
| 287 | |
| 288 | def _kill_process(self, process): |
| 289 | # Kill the whole process group (PID == GPID after setsid). |
no test coverage detected