diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-09-02 17:21:15 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-09-02 17:06:52 +0000 |
commit | 104b80a75c1a092ab70feb65fb1ef1c592d45870 (patch) | |
tree | 3b9b1ad8fd7e7697e31b3bc2e689f95579bad7bd | |
parent | 0448884695b45d49e065aa4837db33fe2f06ba7e (diff) | |
download | meson-104b80a75c1a092ab70feb65fb1ef1c592d45870.zip meson-104b80a75c1a092ab70feb65fb1ef1c592d45870.tar.gz meson-104b80a75c1a092ab70feb65fb1ef1c592d45870.tar.bz2 |
symbolextractor: Handle PermissionError when running tool
I can't reproduce this, but it is definitely possible. In this case
what we should do is the same as when the tool is not found.
Fixes https://github.com/mesonbuild/meson/issues/7605
-rw-r--r-- | mesonbuild/scripts/symbolextractor.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index f4084be..cf486af 100644 --- a/mesonbuild/scripts/symbolextractor.py +++ b/mesonbuild/scripts/symbolextractor.py @@ -80,6 +80,9 @@ def call_tool(name: str, args: T.List[str], **kwargs) -> str: except FileNotFoundError: print_tool_warning(tool, 'not found') return None + except PermissionError: + print_tool_warning(tool, 'not usable') + return None if p.returncode != 0: print_tool_warning(tool, 'does not work', e) return None @@ -90,6 +93,8 @@ def call_tool_nowarn(tool: T.List[str], **kwargs) -> T.Tuple[str, str]: p, output, e = Popen_safe(tool, **kwargs) except FileNotFoundError: return None, '{!r} not found\n'.format(tool[0]) + except PermissionError: + return None, '{!r} not usable\n'.format(tool[0]) if p.returncode != 0: return None, e return output, None |