fix bug when there is version id in the path of compiler (#26916)

This commit is contained in:
Hao Lyu 2021-10-27 05:12:58 +08:00 committed by GitHub
parent 9a637bbd09
commit 02bea6d2d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,8 +197,8 @@ def answer_configure_question(self, outputbuf):
if "Please select from among the following" in outputbuf:
options = collect_platform_options(outputbuf)
comp_pair = "%s/%s" % (
basename(self.compiler.fc),
basename(self.compiler.cc),
basename(self.compiler.fc).split("-")[0],
basename(self.compiler.cc).split("-")[0],
)
compiler_matches = dict(
(x, y) for x, y in options.items() if comp_pair in x.lower()