From 157521430fdbed9523479d3f34677e2a03aec127 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Wed, 4 Sep 2024 12:09:47 +0000 Subject: [PATCH] Fix Python syntax error in doxygen markdown preprocessor CodeQL was complaining that it couldn't scan our Python code for the invalid use of `**`. Python does not support repeat unpacking in that way, so use a list instead of a dict. --- .../doxygen-markdown-preprocessor.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/doxygen-root/doxygen-markdown/doxygen-markdown-preprocessor.py b/doc/doxygen-root/doxygen-markdown/doxygen-markdown-preprocessor.py index 034b24e7bc1..85a7b257c86 100755 --- a/doc/doxygen-root/doxygen-markdown/doxygen-markdown-preprocessor.py +++ b/doc/doxygen-root/doxygen-markdown/doxygen-markdown-preprocessor.py @@ -53,15 +53,15 @@ def parse_arguments(): def pandoc(path, pandoc_write, pandoc_wrap, pandoc_filter=None): - args = { - '--write': pandoc_write, - '--wrap': pandoc_wrap - } + args = [ + '--write', pandoc_write, + '--wrap', pandoc_wrap + ] if pandoc_filter: - args['--filter'] = Path(pandoc_filter).resolve() + args.extend(['--filter', Path(pandoc_filter).resolve()]) - lines = subprocess.run(['pandoc', **args, path], + lines = subprocess.run(['pandoc', *args, path], check=True, text=True, capture_output=True).stdout.splitlines()