Simplified control flow.

This commit is contained in:
Jussi Pakkanen 2017-07-16 12:00:04 +03:00
parent b52955ff3d
commit 76d6fab8ae
1 changed files with 9 additions and 9 deletions

View File

@ -2007,9 +2007,6 @@ class Interpreter(InterpreterBase):
raise DependencyException(m.format(name))
dep = cached_dep
else:
# We need to actually search for this dep
exception = None
dep = None
# If the dependency has already been configured, possibly by
# a higher level project, try to use it first.
if 'fallback' in kwargs:
@ -2022,13 +2019,16 @@ class Interpreter(InterpreterBase):
except KeyError:
pass
# We need to actually search for this dep
exception = None
dep = None
# Search for it outside the project
if not dep:
try:
dep = dependencies.find_external_dependency(name, self.environment, kwargs)
except DependencyException as e:
exception = e
pass
try:
dep = dependencies.find_external_dependency(name, self.environment, kwargs)
except DependencyException as e:
exception = e
pass
# Search inside the projects list
if not dep or not dep.found():