From a20149930630b8b437da5ba4d524f3ec0dc10e18 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 16 Aug 2019 23:54:05 +0300 Subject: Only iterate over existing libdirs. --- mesonbuild/mesonlib.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 1223b2c..d90c188 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -704,11 +704,15 @@ def get_library_dirs() -> typing.List[str]: else: plat = '' - unixdirs += [str(x) for x in (Path('/usr/lib/') / plat).iterdir() if x.is_dir()] + usr_platdir = Path('/usr/lib/') / plat + if usr_platdir.is_dir(): + unixdirs += [str(x) for x in (usr_platdir).iterdir() if x.is_dir()] if os.path.exists('/usr/lib64'): unixdirs.append('/usr/lib64') - unixdirs += [str(x) for x in (Path('/lib/') / plat).iterdir() if x.is_dir()] + lib_platdir = Path('/lib/') / plat + if lib_platdir.is_dir(): + unixdirs += [str(x) for x in (lib_platdir).iterdir() if x.is_dir()] if os.path.exists('/lib64'): unixdirs.append('/lib64') -- cgit v1.1