aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-10-05 09:17:24 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-11-01 12:24:25 -0700
commitfec7b2c07f2e07979880e12555015113686f69a1 (patch)
tree83961b2e9100fb0b168fc217ff725ae73b030800 /mesonbuild
parent09a1528ce0897e21c2cae1f6fd9772ce2b30cd55 (diff)
downloadmeson-fec7b2c07f2e07979880e12555015113686f69a1.zip
meson-fec7b2c07f2e07979880e12555015113686f69a1.tar.gz
meson-fec7b2c07f2e07979880e12555015113686f69a1.tar.bz2
interpreter/modules: ModuleReturnValue can hold ExecutableSerialisation
The code for this exists and works, but the type annotations don't allow it. This fixes the annotations
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter/interpreter.py2
-rw-r--r--mesonbuild/modules/__init__.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index fc1367f..a565305 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -455,7 +455,7 @@ class Interpreter(InterpreterBase, HoldableObject):
held_type: holder_type
})
- def process_new_values(self, invalues: T.List[TYPE_var]) -> None:
+ def process_new_values(self, invalues: T.List[T.Union[TYPE_var, ExecutableSerialisation]]) -> None:
invalues = listify(invalues)
for v in invalues:
if isinstance(v, ObjectHolder):
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py
index bd62b6e..53f1660 100644
--- a/mesonbuild/modules/__init__.py
+++ b/mesonbuild/modules/__init__.py
@@ -192,10 +192,11 @@ def is_module_library(fname):
class ModuleReturnValue:
- def __init__(self, return_value: T.Optional['TYPE_var'], new_objects: T.Sequence['TYPE_var']) -> None:
+ def __init__(self, return_value: T.Optional['TYPE_var'],
+ new_objects: T.Sequence[T.Union['TYPE_var', 'build.ExecutableSerialisation']]) -> None:
self.return_value = return_value
assert isinstance(new_objects, list)
- self.new_objects = new_objects
+ self.new_objects: T.List[T.Union['TYPE_var', 'build.ExecutableSerialisation']] = new_objects
class GResourceTarget(build.CustomTarget):
pass