aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreterobjects.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-06-01 20:44:32 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-06-15 12:48:53 -0700
commit2ac9b323918e8c61c4707fbd79d45cf1c6eecfd0 (patch)
tree784d8f3ae230247d25ac3cb714573af8844a64d6 /mesonbuild/interpreter/interpreterobjects.py
parentd064466e8bffb958d75cab30f68ae17c2c022b92 (diff)
downloadmeson-2ac9b323918e8c61c4707fbd79d45cf1c6eecfd0.zip
meson-2ac9b323918e8c61c4707fbd79d45cf1c6eecfd0.tar.gz
meson-2ac9b323918e8c61c4707fbd79d45cf1c6eecfd0.tar.bz2
interpreter: Do not create Generator in GeneratorHolder
This is an odd pattern, not the way most Holders work, and would be problematic if a method wanted to return a Generator.
Diffstat (limited to 'mesonbuild/interpreter/interpreterobjects.py')
-rw-r--r--mesonbuild/interpreter/interpreterobjects.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py
index f7c8466..8913b21 100644
--- a/mesonbuild/interpreter/interpreterobjects.py
+++ b/mesonbuild/interpreter/interpreterobjects.py
@@ -621,11 +621,12 @@ class ExternalLibraryHolder(InterpreterObject, ObjectHolder[ExternalLibrary]):
return DependencyHolder(pdep, self.subproject)
class GeneratorHolder(InterpreterObject, ObjectHolder[build.Generator]):
+
@FeatureNewKwargs('generator', '0.43.0', ['capture'])
- def __init__(self, interp, args, kwargs):
- self.interpreter = interp
+ def __init__(self, gen: 'build.Generator', interpreter: 'Interpreter'):
InterpreterObject.__init__(self)
- ObjectHolder.__init__(self, build.Generator(args, kwargs), interp.subproject)
+ ObjectHolder.__init__(self, gen, interpreter.subproject)
+ self.interpreter = interpreter
self.methods.update({'process': self.process_method})
@FeatureNewKwargs('generator.process', '0.45.0', ['preserve_path_from'])