scripts: Fix twisterlib for ruff - UP021, UP022

This fixes ruff linting errors UP021 and UP022,
where obsolete subprocess parameters were
still used.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
This commit is contained in:
Lukasz Mrugala 2024-11-27 12:25:29 +00:00 committed by Carles Cufí
commit fbde9f1b1a
4 changed files with 21 additions and 15 deletions

View file

@ -1093,8 +1093,13 @@ class ProjectBuilder(FilterBuilder):
def demangle(self, symbol_name):
if symbol_name[:2] == '_Z':
try:
cpp_filt = subprocess.run('c++filt', input=symbol_name, text=True, check=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
cpp_filt = subprocess.run(
'c++filt',
input=symbol_name,
text=True,
check=True,
capture_output=True
)
if self.trace:
logger.debug(f"Demangle: '{symbol_name}'==>'{cpp_filt.stdout}'")
return cpp_filt.stdout.strip()