1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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.
This commit is contained in:
Marian Buschsieweke 2022-06-14 12:30:06 +02:00
parent c5083303f6
commit a5f52cbbb7
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -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)