interpreterbase/decorators: delete now unused stringArgs

pull/13739/head
Dylan Baker 3 months ago
parent 60e2da24c0
commit f9c2a68372
  1. 2
      mesonbuild/interpreterbase/__init__.py
  2. 13
      mesonbuild/interpreterbase/decorators.py

@ -28,7 +28,6 @@ __all__ = [
'noPosargs',
'noKwargs',
'stringArgs',
'noArgsFlattening',
'noSecondLevelHolderResolving',
'unholder_return',
@ -87,7 +86,6 @@ from .baseobjects import (
from .decorators import (
noPosargs,
noKwargs,
stringArgs,
noArgsFlattening,
noSecondLevelHolderResolving,
unholder_return,

@ -62,19 +62,6 @@ def noKwargs(f: TV_func) -> TV_func:
return f(*wrapped_args, **wrapped_kwargs)
return T.cast('TV_func', wrapped)
def stringArgs(f: TV_func) -> TV_func:
@wraps(f)
def wrapped(*wrapped_args: T.Any, **wrapped_kwargs: T.Any) -> T.Any:
args = get_callee_args(wrapped_args)[1]
if not isinstance(args, list):
mlog.debug('Not a list:', str(args))
raise InvalidArguments('Argument not a list.')
if not all(isinstance(s, str) for s in args):
mlog.debug('Element not a string:', str(args))
raise InvalidArguments('Arguments must be strings.')
return f(*wrapped_args, **wrapped_kwargs)
return T.cast('TV_func', wrapped)
def noArgsFlattening(f: TV_func) -> TV_func:
setattr(f, 'no-args-flattening', True) # noqa: B010
return f

Loading…
Cancel
Save