[3/7] libstdc++: Remove unused Python imports

Message ID 20230928174630.4004388-4-tromey@adacore.com
State Unresolved
Headers
Series libstdc++: Use gdb.ValuePrinter in pretty-printers |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Tom Tromey Sept. 28, 2023, 5:46 p.m. UTC
  flake8 pointed out some unused imports.

libstdc++-v3/ChangeLog:

        * python/libstdcxx/v6/printers.py: Don't import 'os'.
        * python/libstdcxx/v6/__init__.py: Don't import 'gdb'.
---
 libstdc++-v3/python/libstdcxx/v6/__init__.py | 2 --
 libstdc++-v3/python/libstdcxx/v6/printers.py | 1 -
 2 files changed, 3 deletions(-)
  

Comments

Jonathan Wakely Sept. 28, 2023, 6:53 p.m. UTC | #1
On Thu, 28 Sept 2023, 18:50 Tom Tromey via Libstdc++, <libstdc++@gcc.gnu.org>
wrote:

> flake8 pointed out some unused imports.
>

OK, thanks.



> libstdc++-v3/ChangeLog:
>
>         * python/libstdcxx/v6/printers.py: Don't import 'os'.
>         * python/libstdcxx/v6/__init__.py: Don't import 'gdb'.
> ---
>  libstdc++-v3/python/libstdcxx/v6/__init__.py | 2 --
>  libstdc++-v3/python/libstdcxx/v6/printers.py | 1 -
>  2 files changed, 3 deletions(-)
>
> diff --git a/libstdc++-v3/python/libstdcxx/v6/__init__.py
> b/libstdc++-v3/python/libstdcxx/v6/__init__.py
> index df654acd0c2..8b2cbc60a1b 100644
> --- a/libstdc++-v3/python/libstdcxx/v6/__init__.py
> +++ b/libstdc++-v3/python/libstdcxx/v6/__init__.py
> @@ -13,8 +13,6 @@
>  # 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
> -
>  # Load the xmethods if GDB supports them.
>  def gdb_has_xmethods():
>      try:
> diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py
> b/libstdc++-v3/python/libstdcxx/v6/printers.py
> index bbc4375541f..8d44244afb0 100644
> --- a/libstdc++-v3/python/libstdcxx/v6/printers.py
> +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
> @@ -19,7 +19,6 @@ import gdb
>  import itertools
>  import re
>  import sys
> -import os
>  import errno
>  import datetime
>
> --
> 2.40.1
>
>
  

Patch

diff --git a/libstdc++-v3/python/libstdcxx/v6/__init__.py b/libstdc++-v3/python/libstdcxx/v6/__init__.py
index df654acd0c2..8b2cbc60a1b 100644
--- a/libstdc++-v3/python/libstdcxx/v6/__init__.py
+++ b/libstdc++-v3/python/libstdcxx/v6/__init__.py
@@ -13,8 +13,6 @@ 
 # 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
-
 # Load the xmethods if GDB supports them.
 def gdb_has_xmethods():
     try:
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index bbc4375541f..8d44244afb0 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -19,7 +19,6 @@  import gdb
 import itertools
 import re
 import sys
-import os
 import errno
 import datetime