From 104b80a75c1a092ab70feb65fb1ef1c592d45870 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 2 Sep 2020 17:21:15 +0530 Subject: [PATCH] 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 --- mesonbuild/scripts/symbolextractor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index f4084bea8..cf486afb2 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