MCPcopy
hub / github.com/pex-tool/pex / open_process

Method open_process

pex/executor.py:61–77  ·  view source on GitHub ↗

Opens a process object via subprocess.Popen(). :param string|list cmd: A list or string representing the command to run. :param **kwargs: Additional kwargs to pass through to subprocess.Popen. :return: A `subprocess.Popen` object. :raises: `Executor.ExecutableNotFoun

(cls, cmd, **kwargs)

Source from the content-addressed store, hash-verified

59
60 @classmethod
61 def open_process(cls, cmd, **kwargs):
62 """Opens a process object via subprocess.Popen().
63
64 :param string|list cmd: A list or string representing the command to run.
65 :param **kwargs: Additional kwargs to pass through to subprocess.Popen.
66 :return: A `subprocess.Popen` object.
67 :raises: `Executor.ExecutableNotFound` when the executable requested to run does not exist.
68 """
69 assert len(cmd) > 0, "cannot execute an empty command!"
70
71 try:
72 return subprocess.Popen(cmd, **kwargs)
73 except (IOError, OSError) as e:
74 if e.errno == errno.ENOENT:
75 raise cls.ExecutableNotFound(cmd, e)
76 else:
77 raise cls.ExecutionError(repr(e), cmd, e)
78
79 @classmethod
80 def execute(cls, cmd, stdin_payload=None, **kwargs):

Callers 13

execute_externalMethod · 0.45
runMethod · 0.45
executeMethod · 0.45
serveMethod · 0.45
createMethod · 0.45
runMethod · 0.45
bdist_pexFunction · 0.45
test_issues_892Function · 0.45
spawn_python_jobFunction · 0.45

Calls

no outgoing calls