compilers/compilers: Fix get_linker_id
Which could raise an AttributeError when used on languages like Java and
C# that don't have separate compilers and linkers.
@@ -724,7 +724,13 @@ class Compiler:
return self.id
def get_linker_id(self) -> str:
+ # There is not guarantee that we have a dynamic linker instance, as
+ # some languages don't have separate linkers and compilers. In those
+ # cases return the compiler id
+ try:
return self.linker.id
+ except AttributeError:
+ return self.id
def get_version_string(self) -> str:
details = [self.id, self.version]
