From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9918D3858CDB for ; Tue, 11 Oct 2022 09:41:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9918D3858CDB Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-MH9Ph11oMSa5pwwZWXIXEA-1; Tue, 11 Oct 2022 05:41:13 -0400 X-MC-Unique: MH9Ph11oMSa5pwwZWXIXEA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ABD86882821 for ; Tue, 11 Oct 2022 09:41:12 +0000 (UTC) Received: from ovpn-194-127.brq.redhat.com (ovpn-194-127.brq.redhat.com [10.40.194.127]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 269BEC68E50; Tue, 11 Oct 2022 09:41:11 +0000 (UTC) From: Bruno Larsen To: gdb-patches@sourceware.org Subject: [OBV/pushed] [PATCH] gdb/testsuite: Fix formatting of python script Date: Tue, 11 Oct 2022 11:40:44 +0200 Message-Id: <20221011094043.3409096-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP 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: Tue, 11 Oct 2022 09:41:16 -0000 The python black formatter was complaining about formatting on the script gdb.python/pretty-print-call-by-hand.py. This commit changed the offending lines to make the formatter happy. --- gdb/testsuite/gdb.python/pretty-print-call-by-hand.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py b/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py index f8f5df678f8..5343af831a7 100644 --- a/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py +++ b/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py @@ -21,21 +21,25 @@ class MytypePrinter: self.val = val def to_string(self): - calls = gdb.parse_and_eval('f()') - return "mytype is %s" % self.val['x'] + calls = gdb.parse_and_eval("f()") + return "mytype is %s" % self.val["x"] + def ec_lookup_function(val): typ = val.type if typ.code == gdb.TYPE_CODE_REF: typ = typ.target() - if str(typ) == 'struct mytype': + if str(typ) == "struct mytype": return MytypePrinter(val) return None + def disable_lookup_function(): ec_lookup_function.enabled = False + def enable_lookup_function(): ec_lookup_function.enabled = True + gdb.pretty_printers.append(ec_lookup_function) -- 2.37.3