From c93395bfc7c3ff734573c599f7dbcc8fe12681e9 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Sun, 23 Aug 2020 21:06:05 -0700 Subject: [PATCH] compilers/mixins/c2000: Make mypy safe --- mesonbuild/compilers/mixins/c2000.py | 7 ++++++- run_mypy.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers/mixins/c2000.py b/mesonbuild/compilers/mixins/c2000.py index 65a2ceae4..eb66003aa 100644 --- a/mesonbuild/compilers/mixins/c2000.py +++ b/mesonbuild/compilers/mixins/c2000.py @@ -47,7 +47,12 @@ c2000_debug_args = { class C2000Compiler: - def __init__(self): + + if T.TYPE_CHECKING: + is_cross = True + can_compile_suffixes = set() # type: T.Set[str] + + def __init__(self) -> None: if not self.is_cross: raise EnvironmentException('c2000 supports only cross-compilation.') self.id = 'c2000' diff --git a/run_mypy.py b/run_mypy.py index 4c83fe234..1005e9c4c 100755 --- a/run_mypy.py +++ b/run_mypy.py @@ -16,6 +16,7 @@ modules = [ 'mesonbuild/arglist.py', 'mesonbuild/compilers/compilers.py', 'mesonbuild/compilers/mixins/arm.py', + 'mesonbuild/compilers/mixins/c2000.py', # 'mesonbuild/compilers/mixins/intel.py', # 'mesonbuild/coredata.py', 'mesonbuild/dependencies/boost.py',