dub module: use typed_pos_args to check positional arguments

We cannot use typed_kwargs though, because we allow fully arbitrary
kwargs and add them as keys in the generated dub file.
pull/10096/head
Eli Schwartz 3 years ago
parent 9c7868e343
commit 71a5db0a03
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 6
      mesonbuild/modules/dlang.py

@ -21,7 +21,7 @@ import os
from . import ExtensionModule
from .. import dependencies
from .. import mlog
from ..interpreterbase import FeatureNew
from ..interpreterbase import FeatureNew, typed_pos_args
from ..mesonlib import Popen_safe, MesonException
class DlangModule(ExtensionModule):
@ -52,13 +52,11 @@ class DlangModule(ExtensionModule):
if not self.dubbin:
raise MesonException('DUB not found.')
@typed_pos_args('dlang.generate_dub_file', str, str)
def generate_dub_file(self, state, args, kwargs):
if not DlangModule.init_dub:
self._init_dub(state)
if len(args) < 2:
raise MesonException('Missing arguments')
config = {
'name': args[0]
}

Loading…
Cancel
Save