Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32F78EB64DA for ; Tue, 18 Jul 2023 09:27:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.565025.882849 (Exim 4.92) (envelope-from ) id 1qLgyz-0000q1-P9; Tue, 18 Jul 2023 09:27:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 565025.882849; Tue, 18 Jul 2023 09:27:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qLgyz-0000pq-ML; Tue, 18 Jul 2023 09:27:01 +0000 Received: by outflank-mailman (input) for mailman id 565025; Tue, 18 Jul 2023 09:27:00 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qLgyy-0000LP-1t for xen-devel@lists.xenproject.org; Tue, 18 Jul 2023 09:27:00 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id 3df795e6-254d-11ee-8611-37d641c3527e; Tue, 18 Jul 2023 11:26:58 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 40931FEC; Tue, 18 Jul 2023 02:27:41 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 299CF3F67D; Tue, 18 Jul 2023 02:26:57 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3df795e6-254d-11ee-8611-37d641c3527e From: Luca Fancellu To: xen-devel@lists.xenproject.org Cc: wei.chen@arm.com, Stefano Stabellini Subject: [PATCH 2/2] xen/misra: diff-report.py: fix function invocation Date: Tue, 18 Jul 2023 10:26:36 +0100 Message-Id: <20230718092637.2433974-3-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230718092637.2433974-1-luca.fancellu@arm.com> References: <20230718092637.2433974-1-luca.fancellu@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fix the invocation of invoke_command() that takes an optional parameter for the exception type, but in the code the error message template was passed instead, so fix it passing a new exception type. Fixes: 1d7c45f895b6 ("xen/misra: diff-report.py: add report patching feature") Signed-off-by: Luca Fancellu --- xen/scripts/diff-report.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/scripts/diff-report.py b/xen/scripts/diff-report.py index 636f98f5eebe..a1fe6bc2fccd 100755 --- a/xen/scripts/diff-report.py +++ b/xen/scripts/diff-report.py @@ -13,6 +13,10 @@ from xen_analysis.settings import repo_dir from xen_analysis.utils import invoke_command +class DiffReportError(Exception): + pass + + def log_info(text, end='\n'): # type: (str, str) -> None global args @@ -97,7 +101,7 @@ def main(argv): git_diff = invoke_command( "git --git-dir={}/.git diff -C -C {}..{}" .format(repo_dir, args.baseline_rev, args.report_rev), - True, "Error occured invoking:\n{}\n\n{}" + True, DiffReportError, "Error occured invoking:\n{}\n\n{}" ) diff_source = git_diff.splitlines(keepends=True) if diff_source: @@ -105,7 +109,7 @@ def main(argv): diffs = UnifiedFormatParser(diff_source) debug.debug_print_parsed_diff(diffs) log_info(" [OK]") - except (ReportError, UnifiedFormatParseError) as e: + except (DiffReportError, ReportError, UnifiedFormatParseError) as e: print("ERROR: {}".format(e)) sys.exit(1) -- 2.34.1