public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Specify ImportError in styling.py
Date: Tue,  2 Apr 2024 17:09:49 +0000 (GMT)	[thread overview]
Message-ID: <20240402170949.D0C2D3858C78@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=99364b187fd75202a40bc375c278417f0237194e

commit 99364b187fd75202a40bc375c278417f0237194e
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Mar 19 10:56:34 2024 -0600

    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 <simon.marchi@efficios.com>

Diff:
---
 gdb/python/lib/gdb/styling.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

                 reply	other threads:[~2024-04-02 17:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240402170949.D0C2D3858C78@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).