From c7f788e1846082a870dde58d15b355f9aa2cb4a7 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 19 Dec 2016 03:00:17 -0500 Subject: [PATCH] Fix exception when linking with invalid object. If you declare_dependency(link_with : 'string'), an exception is supposed to be raised, but instead of a proper message, it's an exception about a missing attribute. --- mesonbuild/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index cc8f1797e..afd8b0a93 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -748,7 +748,7 @@ class BuildTarget(): if hasattr(t, 'held_object'): t = t.held_object if not isinstance(t, (StaticLibrary, SharedLibrary)): - raise InvalidArguments('Link target {!r} is not library.'.format(t.name)) + raise InvalidArguments('Link target {!r} is not library.'.format(t)) if isinstance(self, SharedLibrary) and isinstance(t, StaticLibrary) and not t.pic: msg = "Can't link non-PIC static library {!r} into shared library {!r}. ".format(t.name, self.name) msg += "Use the 'pic' option to static_library to build with PIC."