From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id D0C2D3858C78; Tue, 2 Apr 2024 17:09:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0C2D3858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712077789; bh=mm2kKncIAHqKMEs+ZLaxj4E7kzGX88UGvWfy7vAoQCY=; h=From:To:Subject:Date:From; b=d3OAKhrP9CvPHIwBQ2M6UabH8XSqrNxPmNHq7+KGAxlBOLFWTDUd66aCKYvfzibrN B4Bqzw+VYLDJQadeP7vkV8vTecR0dAGzzJo9WWaDXF42yhR9L6rAyVAizAJsfAML42 NCH8+UP4gtSgDy6Bp7AZWO+gKeKtmvB3FLvH6Ri8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Specify ImportError in styling.py X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 788050bf18c05f9070cd4240c6ae90c6dee0f030 X-Git-Newrev: 99364b187fd75202a40bc375c278417f0237194e Message-Id: <20240402170949.D0C2D3858C78@sourceware.org> Date: Tue, 2 Apr 2024 17:09:49 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D99364b187fd7= 5202a40bc375c278417f0237194e commit 99364b187fd75202a40bc375c278417f0237194e Author: Tom Tromey Date: Tue Mar 19 10:56:34 2024 -0600 Specify ImportError in styling.py =20 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. =20 Approved-By: Simon Marchi 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 =20 -except: +except ImportError: =20 def colorize(filename, contents): return None