]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: fix flake8 warnings in gdb.base/gdb-index-many-types.py
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 13 Nov 2025 16:47:08 +0000 (11:47 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 13 Nov 2025 16:48:24 +0000 (11:48 -0500)
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

gdb/testsuite/gdb.base/gdb-index-many-types.py

index b1de4f9cbed868253dfbc7ccfeceaf773c9fa32a..7d2b3a7bf0b643d1d74b3213de3dede596193635 100644 (file)
@@ -13,6 +13,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+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 + " }"