|
|
@ -1938,8 +1938,14 @@ class Interpreter(InterpreterBase): |
|
|
|
try: |
|
|
|
try: |
|
|
|
dep = self.subprojects[dirname].get_variable_method([varname], {}) |
|
|
|
dep = self.subprojects[dirname].get_variable_method([varname], {}) |
|
|
|
except KeyError: |
|
|
|
except KeyError: |
|
|
|
raise InvalidCode('Fallback variable {!r} in the subproject ' |
|
|
|
if kwargs.get('required', True): |
|
|
|
'{!r} does not exist'.format(varname, dirname)) |
|
|
|
m = 'Fallback variable {!r} in the subproject {!r} does not exist' |
|
|
|
|
|
|
|
raise DependencyException(m.format(varname, dirname)) |
|
|
|
|
|
|
|
# If the dependency is not required, don't raise an exception |
|
|
|
|
|
|
|
mlog.log('Also couldn\'t find the dependency', mlog.bold(name), |
|
|
|
|
|
|
|
'in the fallback subproject', |
|
|
|
|
|
|
|
mlog.bold(os.path.join(self.subproject_dir, dirname))) |
|
|
|
|
|
|
|
return None |
|
|
|
if not isinstance(dep, DependencyHolder): |
|
|
|
if not isinstance(dep, DependencyHolder): |
|
|
|
raise InvalidCode('Fallback variable {!r} in the subproject {!r} is ' |
|
|
|
raise InvalidCode('Fallback variable {!r} in the subproject {!r} is ' |
|
|
|
'not a dependency object.'.format(varname, dirname)) |
|
|
|
'not a dependency object.'.format(varname, dirname)) |
|
|
|