backends: Simplify loop getting rpaths for bundled libs
No functionality changes
@@ -334,9 +334,11 @@ class Backend:
def rpaths_for_bundled_shared_libraries(self, target):
paths = []
for dep in target.external_deps:
- if isinstance(dep, (dependencies.ExternalLibrary, dependencies.PkgConfigDependency)):
+ if not isinstance(dep, (dependencies.ExternalLibrary, dependencies.PkgConfigDependency)):
+ continue
la = dep.link_args
- if len(la) == 1 and os.path.isabs(la[0]):
+ if len(la) != 1 or not os.path.isabs(la[0]):
+ continue
# The only link argument is an absolute path to a library file.
libpath = la[0]
if libpath.startswith(('/usr/lib', '/lib')):
