From: Simon Marchi Date: Thu, 13 Nov 2025 16:47:08 +0000 (-0500) Subject: gdb: fix flake8 warnings in gdb.base/gdb-index-many-types.py X-Git-Url: https://www.sourceware.org/git/?a=commitdiff_plain;h=c6f30fe326925b8030e63b25c1dc5e987752ef9e;p=binutils-gdb.git gdb: fix flake8 warnings in gdb.base/gdb-index-many-types.py Fix those: gdb/testsuite/gdb.base/gdb-index-many-types.py:17:18: F821 undefined name 'gdb' gdb/testsuite/gdb.base/gdb-index-many-types.py:26:42: F821 undefined name 'gdb' gdb/testsuite/gdb.base/gdb-index-many-types.py:29:16: F821 undefined name 'gdb' gdb/testsuite/gdb.base/gdb-index-many-types.py:31:19: F821 undefined name 'gdb' gdb/testsuite/gdb.base/gdb-index-many-types.py:33:16: F821 undefined name 'gdb' gdb/testsuite/gdb.base/gdb-index-many-types.py:33:51: F821 undefined name 'gdb' gdb/testsuite/gdb.base/gdb-index-many-types.py:47:17: E722 do not use bare 'except' Change-Id: Iba1949a211af66e8dd1e6cb77a44845e5fa60c2e --- diff --git a/gdb/testsuite/gdb.base/gdb-index-many-types.py b/gdb/testsuite/gdb.base/gdb-index-many-types.py index b1de4f9cbed..7d2b3a7bf0b 100644 --- a/gdb/testsuite/gdb.base/gdb-index-many-types.py +++ b/gdb/testsuite/gdb.base/gdb-index-many-types.py @@ -13,6 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import gdb + class TypeViewer(gdb.Command): """A command which takes a string and looks up types with that name. @@ -44,7 +46,7 @@ class TypeViewer(gdb.Command): if len(fields) > 0: fields = fields + " " fields = fields + "%s %s;" % (str(f.type), f.name) - except: + except Exception: pass fields = fields + " }"