summaryrefslogtreecommitdiff
path: root/buildstream/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/utils.py')
-rw-r--r--buildstream/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/utils.py b/buildstream/utils.py
index 3a2372262..f141cb15d 100644
--- a/buildstream/utils.py
+++ b/buildstream/utils.py
@@ -1222,11 +1222,15 @@ def _deduplicate(iterable, key=None):
#
def _parse_version(version):
- versions = version.split(".")
+ try:
+ versions = version.split(".")
+ except AttributeError as e:
+ raise UtilError("Malformed version string: {}".format(version),)
+
try:
major = int(versions[0])
minor = int(versions[1])
except (IndexError, ValueError):
raise UtilError("Malformed version string: {}".format(version),)
- return (major, minor)
+ return major, minor