]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Update black to 26.1.0
authorTom Tromey <tromey@adacore.com>
Thu, 22 Jan 2026 20:41:02 +0000 (13:41 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 23 Jan 2026 13:45:46 +0000 (06:45 -0700)
"pre-commit autoupdate" suggests a new version of black.  This version
seems to want to change how destructuring assignments are formatted.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
.pre-commit-config.yaml
gdb/python/lib/gdb/command/missing_files.py
gdb/python/lib/gdb/command/pretty_printers.py
gdb/python/lib/gdb/command/unwinders.py
gdb/python/lib/gdb/dap/__init__.py
gdb/python/lib/gdb/dap/breakpoint.py
gdb/python/lib/gdb/dap/typecheck.py
gdb/python/lib/gdb/dap/varref.py
gdb/python/lib/gdb/printing.py

index a32a58d37189b52877ddbc41b15323bf961d4e07..15270cda30c2fbe9958badca902baf8f97b293d6 100644 (file)
@@ -42,7 +42,7 @@ default_install_hook_types: [pre-commit, commit-msg]
 default_stages: [pre-commit]
 repos:
   - repo: https://github.com/psf/black-pre-commit-mirror
-    rev: 25.11.0
+    rev: 26.1.0
     hooks:
       - id: black
         types_or: [file]
index 0b512da4f00d737a17804a44b78d7bd2a0292729..dc10d7610fc56ef7fce43b3543c572b3f3d2a073 100644 (file)
@@ -176,7 +176,7 @@ def do_enable_handler1(handlers, name_re, flag, handler_type):
 def do_enable_handler(arg, flag, handler_type):
     """Enable or disable missing file handlers."""
 
-    (locus_re, name_re) = parse_missing_file_command_args(arg)
+    locus_re, name_re = parse_missing_file_command_args(arg)
     total = 0
     if locus_re.match("global"):
         total += do_enable_handler1(
index 2b7b1ec59ecdcf72afcc0c34ecdb49d50f982a91..1775f9177d45106f024865f2da55536345cfeb02 100644 (file)
@@ -152,7 +152,7 @@ class InfoPrettyPrinter(gdb.Command):
 
     def invoke(self, arg, from_tty):
         """GDB calls this to perform the command."""
-        (object_re, name_re, subname_re) = parse_printer_regexps(arg)
+        object_re, name_re, subname_re = parse_printer_regexps(arg)
         self.invoke1(
             "global pretty-printers:",
             gdb.pretty_printers,
@@ -211,16 +211,14 @@ def count_all_enabled_printers():
     """
     enabled_count = 0
     total_count = 0
-    (t_enabled, t_total) = count_enabled_printers(gdb.pretty_printers)
+    t_enabled, t_total = count_enabled_printers(gdb.pretty_printers)
     enabled_count += t_enabled
     total_count += t_total
-    (t_enabled, t_total) = count_enabled_printers(
-        gdb.current_progspace().pretty_printers
-    )
+    t_enabled, t_total = count_enabled_printers(gdb.current_progspace().pretty_printers)
     enabled_count += t_enabled
     total_count += t_total
     for objfile in gdb.objfiles():
-        (t_enabled, t_total) = count_enabled_printers(objfile.pretty_printers)
+        t_enabled, t_total = count_enabled_printers(objfile.pretty_printers)
         enabled_count += t_enabled
         total_count += t_total
     return (enabled_count, total_count)
@@ -238,7 +236,7 @@ def show_pretty_printer_enabled_summary():
     """Print the number of printers enabled/disabled.
     We count subprinters individually.
     """
-    (enabled_count, total_count) = count_all_enabled_printers()
+    enabled_count, total_count = count_all_enabled_printers()
     print("%d of %d printers enabled" % (enabled_count, total_count))
 
 
@@ -307,7 +305,7 @@ def do_enable_pretty_printer_1(pretty_printers, name_re, subname_re, flag):
 
 def do_enable_pretty_printer(arg, flag):
     """Internal worker for enabling/disabling pretty-printers."""
-    (object_re, name_re, subname_re) = parse_printer_regexps(arg)
+    object_re, name_re, subname_re = parse_printer_regexps(arg)
 
     total = 0
     if object_re.match("global"):
index a3a530b6e3c3551d85fca7408fa1004e492ad96e..7c69c5a79670e4a698639dc4e94f918abac79fad 100644 (file)
@@ -129,7 +129,7 @@ def do_enable_unwinder1(unwinders, name_re, flag):
 
 def do_enable_unwinder(arg, flag):
     """Enable/disable unwinder(s)."""
-    (locus_re, name_re) = parse_unwinder_command_args(arg)
+    locus_re, name_re = parse_unwinder_command_args(arg)
     total = 0
     if locus_re.match("global"):
         total += do_enable_unwinder1(gdb.frame_unwinders, name_re, flag)
index 7b1937a5e151a4bfa76ade19ebf73af2f014ec9d..8f68e0cf0b48bff0b737bd5b78e8d6524125396d 100644 (file)
@@ -67,7 +67,7 @@ def run():
 
     # Make the new stdout be a pipe.  This way the DAP code can easily
     # read from the inferior and send OutputEvent to the client.
-    (rfd, wfd) = os.pipe()
+    rfd, wfd = os.pipe()
     os.set_inheritable(rfd, False)
     os.dup2(wfd, 1, True)
     # Also send stderr this way.
index 49b55bb35f9723e8adc9ac0e1df2ed3e8953da97..2634fc8da7a39967f04d75db42ff65eb23259357 100644 (file)
@@ -119,7 +119,7 @@ def _breakpoint_descriptor(bp):
         # https://github.com/microsoft/debug-adapter-protocol/issues/13
         loc = bp.locations[0]
         if loc.source:
-            (filename, line) = loc.source
+            filename, line = loc.source
             if loc.fullname is not None:
                 filename = loc.fullname
 
@@ -161,7 +161,7 @@ def _set_breakpoints(kind, specs, creator):
             # It makes sense to reuse a breakpoint even if the condition
             # or ignore count differs, so remove these entries from the
             # spec first.
-            (condition, hit_condition) = _remove_entries(
+            condition, hit_condition = _remove_entries(
                 spec, "condition", "hitCondition"
             )
             keyspec = frozenset(spec.items())
index d2c42e2c285774e46fefb4c8c4c5a03b1452cdab..9f9f730e200bdf4d8ff1030093974fbf035bd851 100644 (file)
@@ -31,7 +31,7 @@ def _check_instance(value, typevar):
         if not isinstance(value, collections.abc.Mapping):
             return False
         assert len(arg_types) == 2
-        (keytype, valuetype) = arg_types
+        keytype, valuetype = arg_types
         return all(
             _check_instance(k, keytype) and _check_instance(v, valuetype)
             for k, v in value.items()
index 3810abf310a7c478090c8ce745fe58650cba52cf..3cd1ce74fbfaa8c89f084403ae5ae124e74c11ea 100644 (file)
@@ -153,7 +153,7 @@ class BaseReference(ABC):
             if idx >= len(self._children):
                 break
             if self._children[idx] is None:
-                (name, value) = self.fetch_one_child(idx)
+                name, value = self.fetch_one_child(idx)
                 name = self._compute_name(name)
                 var = VariableReference(name, value)
                 self._children[idx] = var
@@ -268,9 +268,9 @@ class VariableReference(BaseReference):
         if isinstance(self._printer, gdb.ValuePrinter) and hasattr(
             self._printer, "child"
         ):
-            (name, val) = self._printer.child(idx)
+            name, val = self._printer.child(idx)
         else:
-            (name, val) = self.cache_children()[idx]
+            name, val = self.cache_children()[idx]
         # A pretty-printer can return something other than a
         # gdb.Value, but it must be convertible.
         if not isinstance(val, gdb.Value):
index 9652617d2cf7b45ce66fe8553ad4f599846c44f1..701a5c4a049adf340d858cc0a50525c330209998 100644 (file)
@@ -343,7 +343,7 @@ class NoOpArrayPrinter(gdb.ValuePrinter):
 
     def __init__(self, ty, value):
         self.__value = value
-        (low, high) = ty.range()
+        low, high = ty.range()
         # In Ada, an array can have an index type that is a
         # non-contiguous enum.  In this case the indexing must be done
         # by using the indices into the enum type, not the underlying