summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2017-04-02 14:12:41 +0200
committerOlav Vitters <olav@vitters.nl>2017-04-02 14:12:41 +0200
commit21a305f987170831cb6ea91e283d38550e4a30d4 (patch)
treed9cd1a6816c321a76619c2d7cf4600699355db1c
parent4d7a4c9e64ff893cd9ce59b9b9b90b2298674ad2 (diff)
downloadmgagnome-21a305f987170831cb6ea91e283d38550e4a30d4.tar
mgagnome-21a305f987170831cb6ea91e283d38550e4a30d4.tar.gz
mgagnome-21a305f987170831cb6ea91e283d38550e4a30d4.tar.bz2
mgagnome-21a305f987170831cb6ea91e283d38550e4a30d4.tar.xz
mgagnome-21a305f987170831cb6ea91e283d38550e4a30d4.zip
safer major minor string parsing
-rwxr-xr-xmgagnome5
1 files changed, 3 insertions, 2 deletions
diff --git a/mgagnome b/mgagnome
index 1dc09c1..a91894e 100755
--- a/mgagnome
+++ b/mgagnome
@@ -158,10 +158,11 @@ def get_majmin(version, module=None):
def get_safe_max_version(version, module=None):
- if version is None or not re_majmin.match(version):
+ m = re_majmin.match(version)
+ if version is None or not m:
return None
- majmin = get_majmin(version, module)
+ majmin = get_majmin(m.group(1), module)
min_nr = int(majmin[1])