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:
parent
cd75bbee9b
commit
3728b228a6
|
@ -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
|
||||
|
|
|
@ -40,7 +40,6 @@ class CcrxCompiler(Compiler):
|
|||
|
||||
if T.TYPE_CHECKING:
|
||||
is_cross = True
|
||||
can_compile_suffixes: T.Set[str] = set()
|
||||
|
||||
id = 'ccrx'
|
||||
|
||||
|
|
Loading…
Reference in New Issue