diff options
author | Michal Suchanek <msuchanek@suse.de> | 2023-01-09 14:34:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-10 11:28:05 +0300 |
commit | 4cc9a2d3b03af48ba88d7dac6ab671d2dffcea25 (patch) | |
tree | 7ac7d0b9bf61d4caff86f701cb3387632c3ba345 /scripts | |
parent | 35812dcac9081e51927bf3410be56192236819c7 (diff) | |
download | linux-4cc9a2d3b03af48ba88d7dac6ab671d2dffcea25.tar.xz |
bpf_doc: Fix build error with older python versions
[ Upstream commit 5fbea42387eba1c7517fcad79099df706def7054 ]
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@suse.de>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20230109113442.20946-1-msuchanek@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bpf_doc.py | 2 |
1 files changed, 1 insertions, 1 deletions
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: |