wpebackend-fdo/0006-meson-Make-scripts-version.py-work-with-older-Python.patch
2021-04-17 08:20:39 -05:00

30 lines
991 B
Diff

From 89e4b1683ad51c1b066fc10c748e5d524fb37cd2 Mon Sep 17 00:00:00 2001
From: Adrian Perez de Castro <aperez@igalia.com>
Date: Wed, 14 Apr 2021 21:56:12 +0300
Subject: [PATCH 06/13] 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 8c4b29f973500a9a596e27a2b3042923e4c905f7)
---
scripts/version.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/version.py b/scripts/version.py
index 1dbbdb3..e2af013 100644
--- a/scripts/version.py
+++ b/scripts/version.py
@@ -18,6 +18,6 @@ with open(version_file, "r") as f:
for line in f.readlines():
m = version_re.match(line)
if m:
- version[m[1]] = m[2]
+ version[m.group(1)] = m.group(2)
print("{}.{}.{}".format(version["MAJOR"], version["MINOR"], version["MICRO"]))
--
2.31.1