MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / _popen

Function _popen

commitizen/cmd.py:39–64  ·  view source on GitHub ↗
(
    cmd: str | Sequence[str],
    *,
    shell: bool,
    env: Mapping[str, str] | None = None,
)

Source from the content-addressed store, hash-verified

37
38
39def _popen(
40 cmd: str | Sequence[str],
41 *,
42 shell: bool,
43 env: Mapping[str, str] | None = None,
44) -> Command:
45 if env is not None:
46 env = {**os.environ, **env}
47
48 process = subprocess.Popen(
49 cmd,
50 shell=shell,
51 stdout=subprocess.PIPE,
52 stderr=subprocess.PIPE,
53 stdin=subprocess.PIPE,
54 env=env,
55 )
56 stdout, stderr = process.communicate()
57 return_code = process.returncode
58 return Command(
59 _try_decode(stdout),
60 _try_decode(stderr),
61 stdout,
62 stderr,
63 return_code,
64 )
65
66
67@overload

Callers 2

runFunction · 0.85
run_shellFunction · 0.85

Calls 2

CommandClass · 0.85
_try_decodeFunction · 0.85

Tested by

no test coverage detected