mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2026-08-27 00:26:02 -04:00
Update black to 26.1.0
"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>
This commit is contained in:
parent
4432c20455
commit
cdc1fd1bcc
9 changed files with 17 additions and 19 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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"):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue