diff --git a/README b/README index 759d61715eac15788694b89fc68ea9ef85085091..5bc67f109adf7d2a6511435f7654c06a4836a47e 100644 --- a/README +++ b/README @@ -6,7 +6,7 @@ __________________________ A valid version is an integer without dot. A version n, may be followed by a ~, to indicate it's inferior to n A version n, may be followed by a +, to indicate it's superior to n -Any following ascii chars after ~ or + are ignored +Any following chars after ~ or + are ignored Examples: 1 < 2 diff --git a/installsystems/tools.py b/installsystems/tools.py index 2269f97f5ac1ade06588b33d8761c387187be4cc..713dd35544e0e32c6af1c45fcd1a4462534cfdb2 100644 --- a/installsystems/tools.py +++ b/installsystems/tools.py @@ -478,9 +478,9 @@ def compare_versions(v1, v2): if type(version) is int or type(version) is float: return float(version) elif isinstance(version, basestring): - iv = re.match("^(\d+)(?:([-~+])\w*)?$", version) + iv = re.match("^(\d+)(?:([-~+]).*)?$", version) if iv is None: - raise TypeError('Invalid version: %s' % version) + raise TypeError('Invalid version format: %s' % version) rv = float(iv.group(1)) if iv.group(2) == "~": rv -= 0.1 @@ -488,7 +488,7 @@ def compare_versions(v1, v2): rv += 0.1 return rv else: - raise TypeError('Invalid version: %s' % version) + raise TypeError('Invalid version format: %s' % version) fv1 = get_ver(v1) fv2 = get_ver(v2)