aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-03-09 10:52:09 -0800
committerEli Schwartz <eschwartz93@gmail.com>2022-05-25 22:41:03 -0400
commit5926190cbb2c5970f35d31b65c40f2da4e4e9254 (patch)
treeda68e539c59209a84926b30e4903b2cad60c45fb /mesonbuild
parent835a697da07ea8e7b9101f6a755ddaba61ab0c36 (diff)
downloadmeson-5926190cbb2c5970f35d31b65c40f2da4e4e9254.zip
meson-5926190cbb2c5970f35d31b65c40f2da4e4e9254.tar.gz
meson-5926190cbb2c5970f35d31b65c40f2da4e4e9254.tar.bz2
interpreter: add annotations to extract_variables
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter/interpreter.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index bf3f192..e787b7a 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -623,7 +623,9 @@ class Interpreter(InterpreterBase, HoldableObject):
return self.source_strings_to_files(args[0])
# Used by declare_dependency() and pkgconfig.generate()
- def extract_variables(self, kwargs, argname='variables', list_new=False, dict_new=False):
+ def extract_variables(self, kwargs: T.Dict[str, T.Union[T.Dict[str, str], T.List[str], str]],
+ argname: str = 'variables', list_new: bool = False,
+ dict_new: bool = False) -> T.Dict[str, str]:
variables = kwargs.get(argname, {})
if isinstance(variables, dict):
if dict_new and variables:
@@ -632,7 +634,7 @@ class Interpreter(InterpreterBase, HoldableObject):
varlist = mesonlib.stringlistify(variables)
if list_new:
FeatureNew.single_use(f'{argname} as list of strings', '0.56.0', self.subproject, location=self.current_node)
- variables = collections.OrderedDict()
+ variables = {}
for v in varlist:
try:
(key, value) = v.split('=', 1)