From f9c2a68372fe03824297307a1d549d9fe3c71101 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 27 Aug 2024 13:14:22 -0700 Subject: [PATCH] interpreterbase/decorators: delete now unused stringArgs --- mesonbuild/interpreterbase/__init__.py | 2 -- mesonbuild/interpreterbase/decorators.py | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/mesonbuild/interpreterbase/__init__.py b/mesonbuild/interpreterbase/__init__.py index 934375a0e..aa38e9490 100644 --- a/mesonbuild/interpreterbase/__init__.py +++ b/mesonbuild/interpreterbase/__init__.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, diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py index fe6f6a53b..06cac526d 100644 --- a/mesonbuild/interpreterbase/decorators.py +++ b/mesonbuild/interpreterbase/decorators.py @@ -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