aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/ast/introspection.py6
-rw-r--r--mesonbuild/ast/postprocess.py6
-rw-r--r--mesonbuild/ast/visitor.py2
3 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index 6e6927f..73cd422 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -21,7 +21,7 @@ from .. import compilers, environment, mesonlib, optinterpreter
from .. import coredata as cdata
from ..mesonlib import MachineChoice
from ..interpreterbase import InvalidArguments, TYPE_nvar
-from ..build import Executable, Jar, SharedLibrary, SharedModule, StaticLibrary
+from ..build import BuildTarget, Executable, Jar, SharedLibrary, SharedModule, StaticLibrary
from ..mparser import BaseNode, ArithmeticNode, ArrayNode, ElementaryNode, IdNode, FunctionNode, StringNode
import typing as T
import os
@@ -173,7 +173,7 @@ class IntrospectionInterpreter(AstInterpreter):
'node': node
}]
- def build_target(self, node: BaseNode, args: T.List[TYPE_nvar], kwargs_raw: T.Dict[str, TYPE_nvar], targetclass) -> T.Optional[T.Dict[str, T.Any]]:
+ def build_target(self, node: BaseNode, args: T.List[TYPE_nvar], kwargs_raw: T.Dict[str, TYPE_nvar], targetclass: T.Type[BuildTarget]) -> T.Optional[T.Dict[str, T.Any]]:
args = self.flatten_args(args)
if not args or not isinstance(args[0], str):
return None
@@ -295,7 +295,7 @@ class IntrospectionInterpreter(AstInterpreter):
return None
def is_subproject(self) -> bool:
- return self.subproject != ''
+ return str(self.subproject) != ''
def analyze(self) -> None:
self.load_root_meson_file()
diff --git a/mesonbuild/ast/postprocess.py b/mesonbuild/ast/postprocess.py
index 35fe1d3..6d808be 100644
--- a/mesonbuild/ast/postprocess.py
+++ b/mesonbuild/ast/postprocess.py
@@ -20,7 +20,7 @@ from .. import mparser
import typing as T
class AstIndentationGenerator(AstVisitor):
- def __init__(self):
+ def __init__(self) -> None:
self.level = 0
def visit_default_func(self, node: mparser.BaseNode) -> None:
@@ -76,7 +76,7 @@ class AstIndentationGenerator(AstVisitor):
self.level -= 1
class AstIDGenerator(AstVisitor):
- def __init__(self):
+ def __init__(self) -> None:
self.counter = {} # type: T.Dict[str, int]
def visit_default_func(self, node: mparser.BaseNode) -> None:
@@ -87,7 +87,7 @@ class AstIDGenerator(AstVisitor):
self.counter[name] += 1
class AstConditionLevel(AstVisitor):
- def __init__(self):
+ def __init__(self) -> None:
self.condition_level = 0
def visit_default_func(self, node: mparser.BaseNode) -> None:
diff --git a/mesonbuild/ast/visitor.py b/mesonbuild/ast/visitor.py
index 451020d..0f2265c 100644
--- a/mesonbuild/ast/visitor.py
+++ b/mesonbuild/ast/visitor.py
@@ -18,7 +18,7 @@
from .. import mparser
class AstVisitor:
- def __init__(self):
+ def __init__(self) -> None:
pass
def visit_default_func(self, node: mparser.BaseNode) -> None: