]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: remove unused but set variables in Python files
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 29 Oct 2025 17:49:21 +0000 (13:49 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 30 Oct 2025 16:21:29 +0000 (12:21 -0400)
commitb4f767797a7c6613516e0da3b1e3d0398ba7d176
tree32ec319340f0a5f90b4155defa182395bd86b943
parent99f7b61f1d00a2b9f85c3defa03764f75184931b
gdb/testsuite: remove unused but set variables in Python files

Fix flake8 errors like this one:

    gdb/testsuite/gdb.python/py-unwind-inline.py:61:17: F841 local variable 'v' is assigned to but never used

For this one, there is a slight possibility that removing a variable
changes some behavior, and perhaps renders some test uneffective (where
the test would no longer exercises what it meant to).  Removing a
variable means that the object it pointed to likely gets de-allocated
earlier (its tp_dealloc method gets called).  So if the intent of the
variable was to ensure the variable outlives the statements that come
after, then this change would be wrong.  But I didn't see any evidence
of that being the intent in all the occurences.

Change-Id: Ic57bc68ad225a43ae6771c47b7f443956e8029a6
Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.multi/multi-target-info-inferiors.py
gdb/testsuite/gdb.python/pretty-print-call-by-hand.py
gdb/testsuite/gdb.python/py-bad-printers.py
gdb/testsuite/gdb.python/py-corefile.py
gdb/testsuite/gdb.python/py-disasm.py
gdb/testsuite/gdb.python/py-frame-args.py
gdb/testsuite/gdb.python/py-pp-registration.py
gdb/testsuite/gdb.python/py-recurse-unwind.py
gdb/testsuite/gdb.python/py-unwind-inline.py
gdb/testsuite/gdb.python/tui-window-disabled.py