aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python3.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-03-03 09:02:49 -0500
committerXavier Claessens <xclaesse@gmail.com>2021-05-28 15:17:10 -0400
commit723c5227a471aff3a1a5a3bc481984c99bf592aa (patch)
tree647154c14f8a8de4f58da4b1bd272a5dfaf30efa /mesonbuild/modules/python3.py
parent495e76d10a65df9e19e96e5470d64644da0e8099 (diff)
downloadmeson-723c5227a471aff3a1a5a3bc481984c99bf592aa.zip
meson-723c5227a471aff3a1a5a3bc481984c99bf592aa.tar.gz
meson-723c5227a471aff3a1a5a3bc481984c99bf592aa.tar.bz2
modules: Remove snippet methods
The only advantage they have is they have the interpreter in arguments, but it's already available as self.interpreter. We should discourage usage of the interpreter API and rely on ModuleState object instead in the future. This also lift the restriction that a module method cannot add build targets, but that was not enforced for snippet methods anyway (and some modules were doing it) and it's really loose restriction as it should check for many other things if we wanted to make it consistent.
Diffstat (limited to 'mesonbuild/modules/python3.py')
-rw-r--r--mesonbuild/modules/python3.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py
index e7a2bb3..4dbb9b5 100644
--- a/mesonbuild/modules/python3.py
+++ b/mesonbuild/modules/python3.py
@@ -26,10 +26,9 @@ class Python3Module(ExtensionModule):
@FeatureDeprecated('python3 module', '0.48.0')
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
- self.snippets.add('extension_module')
@permittedKwargs(known_shmod_kwargs)
- def extension_module(self, interpreter, state, args, kwargs):
+ def extension_module(self, state, args, kwargs):
if 'name_prefix' in kwargs:
raise mesonlib.MesonException('Name_prefix is set automatically, specifying it is forbidden.')
if 'name_suffix' in kwargs:
@@ -45,7 +44,7 @@ class Python3Module(ExtensionModule):
suffix = []
kwargs['name_prefix'] = ''
kwargs['name_suffix'] = suffix
- return interpreter.func_shared_module(None, args, kwargs)
+ return self.interpreter.func_shared_module(None, args, kwargs)
@noKwargs
def find_python(self, state, args, kwargs):