Skip to content

Commit d9d6a05

Browse files
committed
meson: Make scripts/version.py work with older Pythons
Older Python versions (3.5, 2.x) do not have a __getitem__ method on regex match objects, so use the .group() method instead, which is available in all versions. (cherry picked from commit 1635540)
1 parent 5587726 commit d9d6a05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
for line in f.readlines():
1919
m = version_re.match(line)
2020
if m:
21-
version[m[1]] = m[2]
21+
version[m.group(1)] = m.group(2)
2222

2323
print("{}.{}.{}".format(version["MAJOR"], version["MINOR"], version["MICRO"]))

0 commit comments

Comments
 (0)