From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id DAA913850431; Mon, 13 Jun 2022 11:00:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAA913850431 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Handle quotes in gdb_py_module_available X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 8025a164287b588f450686a4b81f6001c33e4269 X-Git-Newrev: f25123df34b037c7f5b3f25eddb7baa1de2befef Message-Id: <20220613110000.DAA913850431@sourceware.org> Date: Mon, 13 Jun 2022 11:00:00 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2022 11:00:01 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df25123df34b0= 37c7f5b3f25eddb7baa1de2befef commit f25123df34b037c7f5b3f25eddb7baa1de2befef Author: Tom de Vries Date: Mon Jun 13 12:59:56 2022 +0200 [gdb/testsuite] Handle quotes in gdb_py_module_available =20 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. =20 Fix this by allowing the single quotes. =20 Tested on x86_64-linux. Diff: --- 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-pytho= n.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}" {