diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-08-16 23:54:05 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-08-17 13:14:05 +0300 |
commit | a20149930630b8b437da5ba4d524f3ec0dc10e18 (patch) | |
tree | 6305f7de9c462a84d097a9da09cbb1275754d504 | |
parent | edec2ee0eeccbe9774d15aee56d492438248fbb4 (diff) | |
download | meson-a20149930630b8b437da5ba4d524f3ec0dc10e18.zip meson-a20149930630b8b437da5ba4d524f3ec0dc10e18.tar.gz meson-a20149930630b8b437da5ba4d524f3ec0dc10e18.tar.bz2 |
Only iterate over existing libdirs.
-rw-r--r-- | mesonbuild/mesonlib.py | 8 |
1 files 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') |