From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id w0gfM+sYp2Jj0wEAWB0awg (envelope-from ) for ; Mon, 13 Jun 2022 07:00:59 -0400 Received: by simark.ca (Postfix, from userid 112) id BF3721E224; Mon, 13 Jun 2022 07:00:59 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ONy3g8P0; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4E07D1E143 for ; Mon, 13 Jun 2022 07:00:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E8F8382CF06 for ; Mon, 13 Jun 2022 11:00:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E8F8382CF06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1655118055; bh=eA29oYNeQCBs8j1s81PUhd9839hCd9MX3y3f+tC8h1s=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ONy3g8P0t4FhyDMPPFk7k9/fMcz7xM/aRzPaZqQ1CEqVvLkkbLoYmx+c2AgYJ7zzz IK6Js64kGUJZrrEQO8WGLoGMTlHkF06eqFBXiQAsET5r7pwcofqP6EWpxd769cBP8u hZHtPBJkijtX7T3j1Ux03vfeDr6SlggNFAUiA+SY= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id E081A3850431 for ; Mon, 13 Jun 2022 11:00:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E081A3850431 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1D23221D80 for ; Mon, 13 Jun 2022 11:00:36 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0A5AB134CF for ; Mon, 13 Jun 2022 11:00:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NsBqAdQYp2LQbAAAMHmgww (envelope-from ) for ; Mon, 13 Jun 2022 11:00:36 +0000 Date: Mon, 13 Jun 2022 13:00:34 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Handle quotes in gdb_py_module_available Message-ID: <20220613110033.GA5153@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, On openSUSE Leap 42.3 with python 3.4, I run into: ... (gdb) python import pygments^M Traceback (most recent call last):^M File "", line 1, in ^M ImportError: No module named 'pygments'^M Error while executing Python code.^M (gdb) FAIL: gdb.base/style.exp: python import pygments ERROR: unexpected output from python import ... because gdb_py_module_available doesn't handle the single quotes around the module name in the ImportError. Fix this by allowing the single quotes. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Handle quotes in gdb_py_module_available --- gdb/testsuite/lib/gdb-python.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb-python.exp b/gdb/testsuite/lib/gdb-python.exp index d5039bbd099..3f004283f08 100644 --- a/gdb/testsuite/lib/gdb-python.exp +++ b/gdb/testsuite/lib/gdb-python.exp @@ -61,7 +61,7 @@ proc gdb_py_module_available { name } { -re -wrap "ModuleNotFoundError: No module named '${name}'.*" { set available false } - -re -wrap "ImportError: No module named ${name}.*" { + -re -wrap "ImportError: No module named '?${name}'?.*" { set available false } -re -wrap "python import ${name}" {