From: Tom Tromey Date: Tue, 19 Mar 2024 16:56:34 +0000 (-0600) Subject: Specify ImportError in styling.py X-Git-Tag: gdb-15-branchpoint~534 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99364b187fd75202a40bc375c278417f0237194e;p=thirdparty%2Fbinutils-gdb.git Specify ImportError in styling.py styling.py has a long try/except surrounding most of the body. flake8 warns about the final bare "except". However, this except is really only there to catch the situation where the host doesn't have Pygments installed. This patch changes this to only catch ImportError. Approved-By: Simon Marchi --- diff --git a/gdb/python/lib/gdb/styling.py b/gdb/python/lib/gdb/styling.py index 9608b5e2048..704c9926c29 100644 --- a/gdb/python/lib/gdb/styling.py +++ b/gdb/python/lib/gdb/styling.py @@ -92,7 +92,7 @@ try: except: return content -except: +except ImportError: def colorize(filename, contents): return None