diff options
author | Tristan Partin <tristan@partin.io> | 2021-08-21 12:17:46 -0500 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-08-22 07:57:29 -0700 |
commit | cd9db63bfbabdc241cc12805ffd84309d90346ab (patch) | |
tree | 12fb15517bde35b3c46ebe061da55bd57685555a | |
parent | 2e7019dd853c1f6fb2b2ecee8e438ded38b674d0 (diff) | |
download | meson-cd9db63bfbabdc241cc12805ffd84309d90346ab.zip meson-cd9db63bfbabdc241cc12805ffd84309d90346ab.tar.gz meson-cd9db63bfbabdc241cc12805ffd84309d90346ab.tar.bz2 |
Add typing to ModuleState machine members
-rw-r--r-- | mesonbuild/modules/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index f88c9d5..85bb99d 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -22,7 +22,7 @@ from ..mesonlib import relpath, HoldableObject from ..interpreterbase.decorators import noKwargs, noPosargs if T.TYPE_CHECKING: - from ..interpreter import Interpreter + from ..interpreter import Interpreter, MachineHolder from ..interpreterbase import TYPE_var, TYPE_kwargs from ..programs import ExternalProgram @@ -55,9 +55,9 @@ class ModuleState: self.man = interpreter.build.get_man() self.global_args = interpreter.build.global_args.host self.project_args = interpreter.build.projects_args.host.get(interpreter.subproject, {}) - self.build_machine = interpreter.builtin['build_machine'].held_object - self.host_machine = interpreter.builtin['host_machine'].held_object - self.target_machine = interpreter.builtin['target_machine'].held_object + self.build_machine = T.cast('MachineHolder', interpreter.builtin['build_machine']).held_object + self.host_machine = T.cast('MachineHolder', interpreter.builtin['host_machine']).held_object + self.target_machine = T.cast('MachineHolder', interpreter.builtin['target_machine']).held_object self.current_node = interpreter.current_node def get_include_args(self, include_dirs: T.Iterable[T.Union[str, build.IncludeDirs]], prefix: str = '-I') -> T.List[str]: |