Skip to content

Commit f65b08f

Browse files
committed
AI review changes
1 parent edf3d32 commit f65b08f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cpp_linter_hooks/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,18 @@ def parse_version(v: str):
6060

6161

6262
def _install_tool(tool: str, version: str) -> Optional[Path]:
63-
"""Install a tool using pip, suppressing output."""
63+
"""Install a tool using pip, logging output on failure."""
6464
result = subprocess.run(
6565
[sys.executable, "-m", "pip", "install", f"{tool}=={version}"],
6666
capture_output=True,
67+
text=True,
6768
)
6869
if result.returncode == 0:
6970
return shutil.which(tool)
7071
else:
7172
LOG.error("pip failed to install %s %s", tool, version)
72-
LOG.error(result.stdout.decode(encoding="utf-8"))
73-
LOG.error(result.stderr.decode(encoding="utf-8"))
73+
LOG.error(result.stdout)
74+
LOG.error(result.stderr)
7475
return None
7576

7677

tests/test_util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def patched_run(*args, **kwargs):
136136
mock_run.assert_called_once_with(
137137
[sys.executable, "-m", "pip", "install", "clang-format==20.1.7"],
138138
capture_output=True,
139+
text=True,
139140
)
140141

141142

0 commit comments

Comments
 (0)