From a5f52cbbb7b1f93da49b76d77fbe4d1b8d3e22f1 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 14 Jun 2022 12:30:06 +0200 Subject: [PATCH] dist/tools/compile_commands: fix error handling detect_includes_and_version_gcc() previously only detected the includes, but has been extended to also return the version. This is done by returning a tuple, with the first item being the list of include paths, and the second being the version. In the error handling the script still returns only an empty list of includes, but not an empty version. This fixes the issue. --- dist/tools/compile_commands/compile_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/tools/compile_commands/compile_commands.py b/dist/tools/compile_commands/compile_commands.py index 85d494d125..c29514418e 100755 --- a/dist/tools/compile_commands/compile_commands.py +++ b/dist/tools/compile_commands/compile_commands.py @@ -35,7 +35,7 @@ def detect_includes_and_version_gcc(compiler): except FileNotFoundError: msg = f"Compiler {compiler} not found, not adding system include paths\n" sys.stderr.write(msg) - return [] + return ([], "") stderrdata = stderrdata.decode("utf-8") version = REGEX_VERSION.search(stderrdata).group(1)