interpreterobjects: use typed_pos_args for dependency.get_pkgconfig_variable

pull/9850/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent 482ab09a95
commit 0fa3436645
  1. 11
      mesonbuild/interpreter/interpreterobjects.py

@ -469,14 +469,9 @@ class DependencyHolder(ObjectHolder[Dependency]):
@FeatureDeprecated('dependency.get_pkgconfig_variable', '0.56.0', @FeatureDeprecated('dependency.get_pkgconfig_variable', '0.56.0',
'use dependency.get_variable(pkgconfig : ...) instead') 'use dependency.get_variable(pkgconfig : ...) instead')
@permittedKwargs({'define_variable', 'default'}) @permittedKwargs({'define_variable', 'default'})
def pkgconfig_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str: @typed_pos_args('dependency.get_pkgconfig_variable', str)
args = listify(args) def pkgconfig_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> str:
if len(args) != 1: return self.held_object.get_pkgconfig_variable(args[0], kwargs)
raise InterpreterException('get_pkgconfig_variable takes exactly one argument.')
varname = args[0]
if not isinstance(varname, str):
raise InterpreterException('Variable name must be a string.')
return self.held_object.get_pkgconfig_variable(varname, kwargs)
@FeatureNew('dependency.get_configtool_variable', '0.44.0') @FeatureNew('dependency.get_configtool_variable', '0.44.0')
@FeatureDeprecated('dependency.get_configtool_variable', '0.56.0', @FeatureDeprecated('dependency.get_configtool_variable', '0.56.0',

Loading…
Cancel
Save