summaryrefslogtreecommitdiff
path: root/python/pkgloader.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/pkgloader.py')
-rw-r--r--python/pkgloader.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/pkgloader.py b/python/pkgloader.py
index a70cb1c3..c371694d 100644
--- a/python/pkgloader.py
+++ b/python/pkgloader.py
@@ -70,7 +70,10 @@ def require(pkg, reqver):
# check if it is actually useful
ver_str = mod.__version__
- ver_str = ver_str.split('-', 1)[0]
+ for i, c in enumerate(ver_str):
+ if c != '.' and not c.isdigit():
+ ver_str = ver_str[:i]
+ break
full_ver = tuple([int(x) for x in ver_str.split('.')])
if full_ver[0] != reqval[0] or reqval > full_ver:
raise ImportError("Request for package '%s' ver '%s', have '%s'" % (