interpreter: Print an error if the fallback dependency variable is not found (#804)

pull/809/head
Nirbheek Chauhan 8 years ago committed by Jussi Pakkanen
parent 5b34e560e5
commit 9c6369c759
  1. 7
      mesonbuild/interpreter.py

@ -1818,9 +1818,12 @@ class Interpreter():
raise raise
else: else:
return None return None
dep = self.subprojects[dirname].get_variable_method([varname], {}) try:
dep = self.subprojects[dirname].get_variable_method([varname], {})
except KeyError:
raise InterpreterException('Fallback variable {!r} in the subproject {!r} does not exist'.format(varname, dirname))
if not isinstance(dep, (DependencyHolder, InternalDependencyHolder)): if not isinstance(dep, (DependencyHolder, InternalDependencyHolder)):
raise InterpreterException('Fallback variable is not a dependency object.') raise InterpreterException('Fallback variable {!r} in the subproject {!r} is not a dependency object.'.format(varname, dirname))
# Check if the version of the declared dependency matches what we want # Check if the version of the declared dependency matches what we want
if 'version' in kwargs: if 'version' in kwargs:
wanted = kwargs['version'] wanted = kwargs['version']

Loading…
Cancel
Save