[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230109113442.20946-1-msuchanek@suse.de>
Date: Mon, 9 Jan 2023 12:34:42 +0100
From: Michal Suchanek <msuchanek@...e.de>
To: unlisted-recipients:; (no To-header on input)
Cc: Michal Suchanek <msuchanek@...e.de>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Quentin Monnet <quentin@...valent.com>,
bpf@...r.kernel.org (open list:BPF [GENERAL] (Safe Dynamic Programs and
Tools)), linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] bpf_doc: Fix build error with older python versions
The ability to subscript match result as an array is only available
since python 3.6. Existing code in bpf_doc uses the older group()
interface but commit 8a76145a2ec2 adds code using the new interface.
Use the old interface consistently to avoid build error on older
distributions like the below:
+ make -j48 -s -C /dev/shm/kbuild/linux.33946/current ARCH=powerpc HOSTCC=gcc CROSS_COMPILE=powerpc64-suse-linux- clean
TypeError: '_sre.SRE_Match' object is not subscriptable
Fixes: 8a76145a2ec2 ("bpf: explicitly define BPF_FUNC_xxx integer values")
Signed-off-by: Michal Suchanek <msuchanek@...e.de>
Acked-by: Quentin Monnet <quentin@...valent.com>
---
v2: Add more details to commit message
---
scripts/bpf_doc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/bpf_doc.py b/scripts/bpf_doc.py
index e8d90829f23e..38d51e05c7a2 100755
--- a/scripts/bpf_doc.py
+++ b/scripts/bpf_doc.py
@@ -271,7 +271,7 @@ class HeaderParser(object):
if capture:
fn_defines_str += self.line
helper_name = capture.expand(r'bpf_\1')
- self.helper_enum_vals[helper_name] = int(capture[2])
+ self.helper_enum_vals[helper_name] = int(capture.group(2))
self.helper_enum_pos[helper_name] = i
i += 1
else:
--
2.35.3
Powered by blists - more mailing lists