[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen/misra: diff-report.py: fix function invocation
commit 55c48d27bde9f0a798c0f7995aa8a155c55b6f11 Author: Luca Fancellu <luca.fancellu@xxxxxxx> AuthorDate: Thu Jul 20 10:03:36 2023 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Thu Jul 20 10:03:36 2023 +0200 xen/misra: diff-report.py: fix function invocation 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 <luca.fancellu@xxxxxxx> Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> --- 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 636f98f5ee..a1fe6bc2fc 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) -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |