aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python3.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-01-08 22:47:57 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-01-09 21:11:48 +0200
commitfbabe8ad85725762e46b7c4c2f2c680c3351ec80 (patch)
treed8293e07d3e66096e9789e41cb04364588f2d841 /mesonbuild/modules/python3.py
parent24221d71ccd341759b008cf1918826910c40247c (diff)
downloadmeson-fbabe8ad85725762e46b7c4c2f2c680c3351ec80.zip
meson-fbabe8ad85725762e46b7c4c2f2c680c3351ec80.tar.gz
meson-fbabe8ad85725762e46b7c4c2f2c680c3351ec80.tar.bz2
There are two different kinds of extensions: modules that create new
objects directly and snippets that just call into interpreter methods.
Diffstat (limited to 'mesonbuild/modules/python3.py')
-rw-r--r--mesonbuild/modules/python3.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py
index 370e925..9b6e71e 100644
--- a/mesonbuild/modules/python3.py
+++ b/mesonbuild/modules/python3.py
@@ -12,13 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from .. import coredata, build
from .. import mesonlib
-import os
-class Python3Module:
+from . import ExtensionModule
- def extension_module(self, state, args, kwargs):
+class Python3Module(ExtensionModule):
+ def __init__(self):
+ super().__init__()
+ self.snippets.add('extension_module')
+
+ def extension_module(self, interpreter, 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:
@@ -34,7 +37,7 @@ class Python3Module:
suffix = []
kwargs['name_prefix'] = ''
kwargs['name_suffix'] = suffix
- return state.interpreter.func_shared_module(None, args, kwargs)
+ return interpreter.func_shared_module(None, args, kwargs)
def initialize():
return Python3Module()