Skip to content

Commit a490250

Browse files
committed
scripts: west_commands: zspdx: getincludes: Fix linter issues
Fix issues reported by ruff. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1 parent c744202 commit a490250

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

.ruff-excludes.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,11 +1232,6 @@
12321232
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
12331233
"UP032", # https://docs.astral.sh/ruff/rules/f-string
12341234
]
1235-
"./scripts/west_commands/zspdx/getincludes.py" = [
1236-
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
1237-
"UP021", # https://docs.astral.sh/ruff/rules/replace-universal-newlines
1238-
"UP022", # https://docs.astral.sh/ruff/rules/replace-stdout-stderr
1239-
]
12401235
"./scripts/west_commands/zspdx/sbom.py" = [
12411236
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
12421237
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports

scripts/west_commands/zspdx/getincludes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
from subprocess import run, PIPE
5+
from subprocess import run
66

77
from west import log
88

@@ -30,7 +30,7 @@ def getCIncludes(compilerPath, srcFile, tcg):
3030
# prepare command invocation
3131
cmd = [compilerPath, "-E", "-H"] + fragments + includes + defines + [srcFile]
3232

33-
cp = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)
33+
cp = run(cmd, capture_output=True, text=True)
3434
if cp.returncode != 0:
3535
log.dbg(f" - calling {compilerPath} failed with error code {cp.returncode}")
3636
return []

0 commit comments

Comments
 (0)