From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E798A3857358 for ; Fri, 15 Jul 2022 01:13:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E798A3857358 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 18F801E222; Thu, 14 Jul 2022 21:13:57 -0400 (EDT) Message-ID: Date: Thu, 14 Jul 2022 21:13:57 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] Update gdb to black 22.6.0 Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20220714184121.1467159-1-tromey@adacore.com> From: Simon Marchi In-Reply-To: <20220714184121.1467159-1-tromey@adacore.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2022 01:14:00 -0000 On 2022-07-14 14:41, Tom Tromey via Gdb-patches wrote: > I couldn't get black 21.12b0 to work correctly -- it always errored, > even with just "--version" -- so instead I make a virtualenv with the > latest release. Running it on gdb yielded two minor changes. > --- > gdb/python/lib/gdb/__init__.py | 7 ++++--- > gdb/testsuite/gdb.python/py-send-packet.py | 6 ++++-- > 2 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py > index 9e9978ef30e..5b10e3e2381 100644 > --- a/gdb/python/lib/gdb/__init__.py > +++ b/gdb/python/lib/gdb/__init__.py > @@ -30,7 +30,8 @@ from _gdb import * > # Historically, gdb.events was always available, so ensure it's > # still available without an explicit import. > import _gdbevents as events > -sys.modules['gdb.events'] = events > + > +sys.modules["gdb.events"] = events > > > class _GdbFile(object): > @@ -243,9 +244,9 @@ def set_parameter(name, value): > # can return them, but they can't be passed to 'set' this way. > if isinstance(value, bool): > if value: > - value = 'on' > + value = "on" > else: > - value = 'off' > + value = "off" > execute("set " + name + " " + str(value), to_string=True) > > > diff --git a/gdb/testsuite/gdb.python/py-send-packet.py b/gdb/testsuite/gdb.python/py-send-packet.py > index ae70b852538..26deeb1e40d 100644 > --- a/gdb/testsuite/gdb.python/py-send-packet.py > +++ b/gdb/testsuite/gdb.python/py-send-packet.py > @@ -114,10 +114,12 @@ def check_global_var(expected_val): > if val != expected_val: > raise gdb.GdbError("global_var is 0x%x, expected 0x%x" % (val, expected_val)) > > + > # Return a bytes object representing an 'X' packet header with > # address ADDR. > -def xpacket_header (addr): > - return ("X%x,4:" % addr).encode('ascii') > +def xpacket_header(addr): > + return ("X%x,4:" % addr).encode("ascii") > + > > # Set the 'X' packet to the remote target to set a global variable. > # Checks that we can send byte values. FWIW, these changes are not related to using a new black version, they are cases of people not running black in previous patches. I am able to run black 21.12.b0, and it yields the exact same changes. Note that in the wiki, I wrote "Use the latest available black version", the goal is not to pin a version. If you notice some changes when running the latest version of black, just push a trivial patch. Simon