aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/dependencies/base.py7
-rwxr-xr-xrun_unittests.py2
2 files changed, 2 insertions, 7 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index c7556e1..64c5100 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -2100,12 +2100,7 @@ def find_external_dependency(name, env, kwargs):
raise DependencyException('Dependency "%s" not found' % (name) +
(', tried %s' % (tried) if tried else ''))
- # return the last failed dependency object
- if pkgdep:
- return pkgdep[-1]
-
- # this should never happen
- raise DependencyException('Dependency "%s" not found, but no dependency object to return' % (name))
+ return NotFoundDependency(env)
def _build_external_dependency_list(name, env, kwargs):
diff --git a/run_unittests.py b/run_unittests.py
index 4d04254..0743de6 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -3471,7 +3471,7 @@ class FailureTests(BasePlatformTests):
code = '''zlib_dep = dependency('zlib', required : false)
zlib_dep.get_configtool_variable('foo')
'''
- self.assertMesonRaises(code, "'zlib' is not a config-tool dependency")
+ self.assertMesonRaises(code, ".* is not a config-tool dependency")
code = '''zlib_dep = dependency('zlib', required : false)
dep = declare_dependency(dependencies : zlib_dep)
dep.get_pkgconfig_variable('foo')