diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-02-12 19:20:39 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-02-26 09:33:26 +0100 |
commit | 03d9bc3b0ede16a426281c666ed8b6981e29112c (patch) | |
tree | f28f9bd6e92a1f0e209ebd78839d8833b999b46b | |
parent | cdc338b74337e29c903bb73b61dc6f22877208e7 (diff) | |
download | meson-03d9bc3b0ede16a426281c666ed8b6981e29112c.zip meson-03d9bc3b0ede16a426281c666ed8b6981e29112c.tar.gz meson-03d9bc3b0ede16a426281c666ed8b6981e29112c.tar.bz2 |
Ignore exceptions
-rw-r--r-- | mesonbuild/dependencies/base.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index e98c122..8bee2ce 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -1115,12 +1115,18 @@ class CMakeDependency(ExternalDependency): def _cached_listdir(self, path: str) -> List[str]: if path not in CMakeDependency.class_listdir_cache: - CMakeDependency.class_listdir_cache[path] = list(map(lambda x: x.lower(), os.listdir(path))) + try: + CMakeDependency.class_listdir_cache[path] = list(map(lambda x: x.lower(), os.listdir(path))) + except: + CMakeDependency.class_listdir_cache[path] = [] return CMakeDependency.class_listdir_cache[path] def _cached_isdir(self, path: str) -> bool: if path not in CMakeDependency.class_isdir_cache: - CMakeDependency.class_isdir_cache[path] = os.path.isdir(path) + try: + CMakeDependency.class_isdir_cache[path] = os.path.isdir(path) + except: + CMakeDependency.class_isdir_cache[path] = False return CMakeDependency.class_isdir_cache[path] def _preliminary_find_check(self, name: str, module_path: List[str]) -> bool: |