public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Suppress star import errors
@ 2024-04-02 17:09 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-04-02 17:09 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=788050bf18c05f9070cd4240c6ae90c6dee0f030

commit 788050bf18c05f9070cd4240c6ae90c6dee0f030
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Mar 19 10:55:30 2024 -0600

    Suppress star import errors
    
    flake8 warns about the "from _gdb.disassembler import *" line in
    disassembler.py, and a similar line from __init__.py.  These line are
    needed to re-export names from the corresponding C++ module, so this
    patch applies the appropriate "noqa" flags.
    
    Approved-By: Simon Marchi <simon.marchi@efficios.com>

Diff:
---
 gdb/python/lib/gdb/__init__.py     | 3 ++-
 gdb/python/lib/gdb/disassembler.py | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py
index 9f0f6dc1e5d..2ff1f95c8fd 100644
--- a/gdb/python/lib/gdb/__init__.py
+++ b/gdb/python/lib/gdb/__init__.py
@@ -26,7 +26,8 @@ if sys.version_info >= (3, 4):
 else:
     from imp import reload
 
-from _gdb import *
+# Note that two indicators are needed here to silence flake8.
+from _gdb import *  # noqa: F401,F403
 
 # Historically, gdb.events was always available, so ensure it's
 # still available without an explicit import.
diff --git a/gdb/python/lib/gdb/disassembler.py b/gdb/python/lib/gdb/disassembler.py
index 2d313ae2122..af7dcc5f6a8 100644
--- a/gdb/python/lib/gdb/disassembler.py
+++ b/gdb/python/lib/gdb/disassembler.py
@@ -19,8 +19,9 @@ import gdb
 import _gdb.disassembler
 
 # Re-export everything from the _gdb.disassembler module, which is
-# defined within GDB's C++ code.
-from _gdb.disassembler import *
+# defined within GDB's C++ code.  Note that two indicators are needed
+# here to silence flake8.
+from _gdb.disassembler import *  # noqa: F401,F403
 
 # Module global dictionary of gdb.disassembler.Disassembler objects.
 # The keys of this dictionary are bfd architecture names, or the

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-02 17:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 17:09 [binutils-gdb] Suppress star import errors Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).