We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0032547 commit f64e5f5Copy full SHA for f64e5f5
commitizen/cmd.py
@@ -38,20 +38,11 @@ def _try_decode(bytes_: bytes) -> str:
38
def run(cmd: str, env: Mapping[str, str] | None = None) -> Command:
39
if env is not None:
40
env = {**os.environ, **env}
41
- process = subprocess.Popen(
42
- cmd,
43
- shell=True,
44
- stdout=subprocess.PIPE,
45
- stderr=subprocess.PIPE,
46
- stdin=subprocess.PIPE,
47
- env=env,
48
- )
49
- stdout, stderr = process.communicate()
50
- return_code = process.returncode
+ c = subprocess.run([cmd], shell=True, capture_output=True, env=env)
51
return Command(
52
- _try_decode(stdout),
53
- _try_decode(stderr),
54
- stdout,
55
- stderr,
56
- return_code,
+ _try_decode(c.stdout),
+ _try_decode(c.stderr),
+ c.stdout,
+ c.stderr,
+ c.returncode,
57
)
0 commit comments