compilers: remove hasattr from `can_compile_suffixes`

This is never set outside the `Compiler.__init__`, only added to. As
such there's no reason to have this `hasattr` check. It's wasting time
*and* confusing our static checkers.
This commit is contained in:
Dylan Baker 2024-10-01 09:31:22 -07:00
parent cd75bbee9b
commit 3728b228a6
2 changed files with 1 additions and 4 deletions

View File

@ -451,10 +451,8 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
full_version: T.Optional[str] = None, is_cross: bool = False):
self.exelist = ccache + exelist
self.exelist_no_ccache = exelist
# In case it's been overridden by a child class already
self.file_suffixes = lang_suffixes[self.language]
if not hasattr(self, 'can_compile_suffixes'):
self.can_compile_suffixes: T.Set[str] = set(self.file_suffixes)
self.can_compile_suffixes = set(self.file_suffixes)
self.default_suffix = self.file_suffixes[0]
self.version = version
self.full_version = full_version

View File

@ -40,7 +40,6 @@ class CcrxCompiler(Compiler):
if T.TYPE_CHECKING:
is_cross = True
can_compile_suffixes: T.Set[str] = set()
id = 'ccrx'