Commit 9a4ce144 authored by Daniel Brown's avatar Daniel Brown

Better version checking

parent cf97ee8e
......@@ -27,7 +27,7 @@ is_container = lambda c: (not isinstance(c, six.string_types)) and hasattr(c, "_
import imp
try:
try:
imp.find_module('optivis')
HAS_OPTIVIS = True
except ImportError:
......@@ -65,13 +65,14 @@ except pkex.MissingFinesse:
warn(msg)
kat = nokat()
v = str(__min_req_finesse__)
version_found = v.split('-')[0].split('.')
version_required = __min_req_finesse__.split('-')[0].split('.')
for a,b in zip(version_found, version_required):
if a < b:
raise pkex.BasePyKatException("Pykat %s requires Finesse version %s or higher. You have have %s" % (__version__ ,
version_found = [int(_) for _ in v.split('-')[0].split('.')]
version_required = [int(_) for _ in __min_req_finesse__.split('-')[0].split('.')]
fulfilled = all([_ == __ for _,__ in zip(version_found, version_required)]) or any([_ > __ for _,__ in zip(version_found, version_required)])
if not fulfilled:
raise pkex.BasePyKatException("Pykat %s requires Finesse version %s or higher. You have have %s" % (__version__ ,
str(__min_req_finesse__),
v))
def info():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment