From: Simon Marchi Date: Wed, 29 Oct 2025 17:49:16 +0000 (-0400) Subject: gdb/testsuite: remove unused imports in Python files X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=168690b0f727d1bce43a758db3fc24a76b394503;p=thirdparty%2Fbinutils-gdb.git gdb/testsuite: remove unused imports in Python files Remove the imports reported as unused by flake8. Change-Id: I6e657de3dea8db18a99e711e594cb92f98e1cebb Approved-By: Tom Tromey --- diff --git a/gdb/testsuite/gdb.dap/stack-format.py b/gdb/testsuite/gdb.dap/stack-format.py index a20f689d8c7..d9ccc56d162 100644 --- a/gdb/testsuite/gdb.dap/stack-format.py +++ b/gdb/testsuite/gdb.dap/stack-format.py @@ -14,8 +14,6 @@ # along with this program. If not, see . -import itertools - import gdb from gdb.FrameDecorator import DAPFrameDecorator diff --git a/gdb/testsuite/gdb.perf/gmonster-null-lookup.py b/gdb/testsuite/gdb.perf/gmonster-null-lookup.py index a4dafaa01c3..825632329d4 100644 --- a/gdb/testsuite/gdb.perf/gmonster-null-lookup.py +++ b/gdb/testsuite/gdb.perf/gmonster-null-lookup.py @@ -17,7 +17,7 @@ # Efficient handling of this case is important, and not just for typos. # Sometimes the debug info for the needed object isn't present. -from perftest import measure, perftest, utils +from perftest import perftest, utils class NullLookup(perftest.TestCaseWithBasicMeasurements): diff --git a/gdb/testsuite/gdb.perf/gmonster-pervasive-typedef.py b/gdb/testsuite/gdb.perf/gmonster-pervasive-typedef.py index dc1fef5a7d6..095e4d1281c 100644 --- a/gdb/testsuite/gdb.perf/gmonster-pervasive-typedef.py +++ b/gdb/testsuite/gdb.perf/gmonster-pervasive-typedef.py @@ -17,7 +17,7 @@ # typedef used pervasively. This exercises the perf regression introduced by # the original patch to pr 16253. -from perftest import measure, perftest, utils +from perftest import perftest, utils class PervasiveTypedef(perftest.TestCaseWithBasicMeasurements): diff --git a/gdb/testsuite/gdb.perf/gmonster-print-cerr.py b/gdb/testsuite/gdb.perf/gmonster-print-cerr.py index be4109c744c..0f201b3e27e 100644 --- a/gdb/testsuite/gdb.perf/gmonster-print-cerr.py +++ b/gdb/testsuite/gdb.perf/gmonster-print-cerr.py @@ -25,7 +25,7 @@ # is that here we do not pre-expand the symtab: we don't want include # GDB's slowness in searching expanded symtabs first to color these results. -from perftest import measure, perftest, utils +from perftest import perftest, utils class PrintCerr(perftest.TestCaseWithBasicMeasurements): diff --git a/gdb/testsuite/gdb.perf/gmonster-ptype-string.py b/gdb/testsuite/gdb.perf/gmonster-ptype-string.py index d4077b5a017..3397b123a1e 100644 --- a/gdb/testsuite/gdb.perf/gmonster-ptype-string.py +++ b/gdb/testsuite/gdb.perf/gmonster-ptype-string.py @@ -19,7 +19,7 @@ # these before it searches the index (there is work-in-progress to fix this), # this test helps measure the issue. -from perftest import measure, perftest, utils +from perftest import perftest, utils class GmonsterPtypeString(perftest.TestCaseWithBasicMeasurements): diff --git a/gdb/testsuite/gdb.perf/gmonster-runto-main.py b/gdb/testsuite/gdb.perf/gmonster-runto-main.py index 0c1349b5782..097c32a1bdd 100644 --- a/gdb/testsuite/gdb.perf/gmonster-runto-main.py +++ b/gdb/testsuite/gdb.perf/gmonster-runto-main.py @@ -15,7 +15,7 @@ # Measure performance of running to main. -from perftest import measure, perftest, utils +from perftest import perftest, utils class GmonsterRuntoMain(perftest.TestCaseWithBasicMeasurements): diff --git a/gdb/testsuite/gdb.perf/gmonster-select-file.py b/gdb/testsuite/gdb.perf/gmonster-select-file.py index a03c2ecd220..05db3624dac 100644 --- a/gdb/testsuite/gdb.perf/gmonster-select-file.py +++ b/gdb/testsuite/gdb.perf/gmonster-select-file.py @@ -15,7 +15,7 @@ # Measure performance of selecting a file to debug. -from perftest import measure, perftest, utils +from perftest import perftest, utils class GmonsterSelectFile(perftest.TestCaseWithBasicMeasurements): diff --git a/gdb/testsuite/gdb.perf/solib.py b/gdb/testsuite/gdb.perf/solib.py index d7266bf55bf..c440635147b 100644 --- a/gdb/testsuite/gdb.perf/solib.py +++ b/gdb/testsuite/gdb.perf/solib.py @@ -16,7 +16,7 @@ # This test case is to test the speed of GDB when it is handling the # shared libraries of inferior are loaded and unloaded. -from perftest import measure, perftest +from perftest import perftest import gdb diff --git a/gdb/testsuite/gdb.python/py-bad-printers.py b/gdb/testsuite/gdb.python/py-bad-printers.py index c93923cb57c..23973ebcb4d 100644 --- a/gdb/testsuite/gdb.python/py-bad-printers.py +++ b/gdb/testsuite/gdb.python/py-bad-printers.py @@ -18,7 +18,6 @@ # Test a printer with a bad children iterator. -import re import gdb.printing diff --git a/gdb/testsuite/gdb.python/py-framefilter-addr.py b/gdb/testsuite/gdb.python/py-framefilter-addr.py index 513bf6f21d4..336571a388d 100644 --- a/gdb/testsuite/gdb.python/py-framefilter-addr.py +++ b/gdb/testsuite/gdb.python/py-framefilter-addr.py @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import copy import itertools import gdb diff --git a/gdb/testsuite/gdb.python/py-framefilter-gdb.py b/gdb/testsuite/gdb.python/py-framefilter-gdb.py index a725dce357d..969371cf009 100644 --- a/gdb/testsuite/gdb.python/py-framefilter-gdb.py +++ b/gdb/testsuite/gdb.python/py-framefilter-gdb.py @@ -13,12 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import itertools - # This file is part of the GDB testsuite. It tests Python-based # frame-filters. import gdb -from gdb.FrameDecorator import FrameDecorator class FrameObjFile: diff --git a/gdb/testsuite/gdb.python/py-framefilter-invalidarg-gdb.py b/gdb/testsuite/gdb.python/py-framefilter-invalidarg-gdb.py index 51922fc96d2..96c97aab1dc 100644 --- a/gdb/testsuite/gdb.python/py-framefilter-invalidarg-gdb.py +++ b/gdb/testsuite/gdb.python/py-framefilter-invalidarg-gdb.py @@ -13,12 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import itertools # This file is part of the GDB testsuite. It tests Python-based # frame-filters. import gdb -from gdb.FrameDecorator import FrameDecorator class FrameObjFile: diff --git a/gdb/testsuite/gdb.python/py-framefilter-invalidarg.py b/gdb/testsuite/gdb.python/py-framefilter-invalidarg.py index b262968aec8..a8e52e04051 100644 --- a/gdb/testsuite/gdb.python/py-framefilter-invalidarg.py +++ b/gdb/testsuite/gdb.python/py-framefilter-invalidarg.py @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import copy import itertools # This file is part of the GDB testsuite. It tests Python-based diff --git a/gdb/testsuite/gdb.python/py-framefilter.py b/gdb/testsuite/gdb.python/py-framefilter.py index 5c3790d33f2..1fc8025ee34 100644 --- a/gdb/testsuite/gdb.python/py-framefilter.py +++ b/gdb/testsuite/gdb.python/py-framefilter.py @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import copy import itertools # This file is part of the GDB testsuite. It tests Python-based diff --git a/gdb/testsuite/gdb.python/py-mi-var-info-path-expression.py b/gdb/testsuite/gdb.python/py-mi-var-info-path-expression.py index e7638dba354..46bbb747262 100644 --- a/gdb/testsuite/gdb.python/py-mi-var-info-path-expression.py +++ b/gdb/testsuite/gdb.python/py-mi-var-info-path-expression.py @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import sys import gdb import gdb.types diff --git a/gdb/testsuite/gdb.python/py-pp-maint.py b/gdb/testsuite/gdb.python/py-pp-maint.py index 8b96cc00040..a7e0815897c 100644 --- a/gdb/testsuite/gdb.python/py-pp-maint.py +++ b/gdb/testsuite/gdb.python/py-pp-maint.py @@ -16,8 +16,6 @@ # This file is part of the GDB testsuite. It tests python pretty # printers. -import re - import gdb.printing import gdb.types diff --git a/gdb/testsuite/gdb.python/py-pp-registration.py b/gdb/testsuite/gdb.python/py-pp-registration.py index e9f3dfb1ea8..4f39e426507 100644 --- a/gdb/testsuite/gdb.python/py-pp-registration.py +++ b/gdb/testsuite/gdb.python/py-pp-registration.py @@ -16,8 +16,6 @@ # This file is part of the GDB testsuite. It tests python pretty # printer registration. -import re - import gdb.printing import gdb.types diff --git a/gdb/testsuite/gdb.python/py-unwind-maint.py b/gdb/testsuite/gdb.python/py-unwind-maint.py index 4a109d5e19d..b6b621b884c 100644 --- a/gdb/testsuite/gdb.python/py-unwind-maint.py +++ b/gdb/testsuite/gdb.python/py-unwind-maint.py @@ -15,10 +15,8 @@ # This file is part of the GDB testsuite. It tests python unwinders. -import re - import gdb.types -from gdb.unwinder import Unwinder, register_unwinder +from gdb.unwinder import Unwinder class TestGlobalUnwinder(Unwinder): diff --git a/gdb/testsuite/gdb.rust/pp.py b/gdb/testsuite/gdb.rust/pp.py index e29240dd156..aac1b48a1bb 100644 --- a/gdb/testsuite/gdb.rust/pp.py +++ b/gdb/testsuite/gdb.rust/pp.py @@ -16,7 +16,6 @@ # This file is part of the GDB testsuite. It tests python pretty # printers. -import re import gdb