MCPcopy Create free account
hub / github.com/nodejs/node / _start_process

Method _start_process

deps/v8/tools/testrunner/local/command.py:216–234  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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).

Callers

nothing calls this directly

Calls 5

_get_envMethod · 0.80
mapFunction · 0.50
joinMethod · 0.45
_get_popen_argsMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected