]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove unused locals from printers.py
authorTom Tromey <tromey@adacore.com>
Tue, 26 Sep 2023 19:58:57 +0000 (13:58 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 28 Sep 2023 20:56:00 +0000 (14:56 -0600)
flake8 pointed out some unused local variables in the libstdc++
pretty-printers.  This removes them.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py
(StdExpOptionalPrinter.__init__, lookup_node_type):
Remove unused variables.

libstdc++-v3/python/libstdcxx/v6/printers.py

index 0f7327b54e926d7906d836357e8131e8fae715b7..c5ecd881b734890730103181514e9f06d41bc34a 100644 (file)
@@ -174,7 +174,7 @@ def lookup_node_type(nodename, containertype):
     valtype = valtype.strip_typedefs()
     try:
         return lookup_templ_spec(nodename, valtype)
-    except gdb.error as e:
+    except gdb.error:
         # For debug mode containers the node is in std::__cxx1998.
         if is_member_of_namespace(nodename, 'std'):
             if is_member_of_namespace(containertype, 'std::__cxx1998',
@@ -1449,7 +1449,6 @@ class StdExpOptionalPrinter(SingleObjContainerPrinter):
     """Print a std::optional or std::experimental::optional."""
 
     def __init__(self, typename, val):
-        valtype = self._recognize(val.type.template_argument(0))
         typename = strip_versioned_namespace(typename)
         self._typename = re.sub(
             r'^std::(experimental::|)(fundamentals_v\d::|)(.*)',