]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Specify ImportError in styling.py
authorTom Tromey <tromey@adacore.com>
Tue, 19 Mar 2024 16:56:34 +0000 (10:56 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 2 Apr 2024 16:58:37 +0000 (10:58 -0600)
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 <simon.marchi@efficios.com>
gdb/python/lib/gdb/styling.py

index 9608b5e2048cfa253c22e60527b0e05e00ceff47..704c9926c29122d3555da093fadae2b602a96110 100644 (file)
@@ -92,7 +92,7 @@ try:
         except:
             return content
 
-except:
+except ImportError:
 
     def colorize(filename, contents):
         return None