From patchwork Fri Sep 16 02:46:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mueller X-Patchwork-Id: 15684 Received: (qmail 39764 invoked by alias); 16 Sep 2016 02:47:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 39707 invoked by uid 89); 16 Sep 2016 02:47:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mout02.posteo.de Received: from mout02.posteo.de (HELO mout02.posteo.de) (185.67.36.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Sep 2016 02:47:03 +0000 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 89C7F20B00 for ; Fri, 16 Sep 2016 04:47:01 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3sb06r47bHzyqG; Fri, 16 Sep 2016 04:47:00 +0200 (CEST) From: Daniel Mueller Subject: Fix string formatting in exception raise To: gdb-patches@sourceware.org Openpgp: id=978EF36D9C17808ADFD2E317BEEB753178F1337C Message-ID: <57DB5D22.2060907@posteo.net> Date: Thu, 15 Sep 2016 19:46:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Hi, The attached patch fixes a string formatting issue when raising a SyntaxError in gdb/python/lib/gdb/command/xmethods.py. Regards, Daniel diff --git gdb/python/lib/gdb/command/xmethods.py gdb/python/lib/gdb/command/xmethods.py index 46f7b6..cadf5c 100644 --- gdb/python/lib/gdb/command/xmethods.py +++ gdb/python/lib/gdb/command/xmethods.py @@ -24,7 +24,7 @@ def validate_xm_regexp(part_name, regexp): try: return re.compile(regexp) except SyntaxError: - raise SyntaxError("Invalid %s regexp: %s", part_name, regexp) + raise SyntaxError("Invalid %s regexp: %s" % (part_name, regexp)) def parse_xm_command_args(arg):