Skip to content

Commit 5d346b8

Browse files
committed
fix: using LooseVersion to perform version comparison
1 parent 3ceb41c commit 5d346b8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nipype/interfaces/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
from ..utils.filemanip import (md5, hash_infile, FileNotFoundError,
2929
hash_timestamp)
3030
from ..utils.misc import is_container, trim
31-
from .. import config, logging
32-
from .. import __version__ as nipype_version
31+
from .. import config, logging, LooseVersion
32+
from .. import __version__
33+
34+
nipype_version = LooseVersion(__version__)
3335

3436
iflogger = logging.getLogger('interface')
3537

@@ -381,7 +383,7 @@ def _deprecated_warn(self, obj, name, old, new):
381383
else:
382384
msg3 = ''
383385
msg = ' '.join((msg1, msg2, msg3))
384-
if str(trait_spec.deprecated) < nipype_version:
386+
if LooseVersion(str(trait_spec.deprecated)) < nipype_version:
385387
raise TraitError(msg)
386388
else:
387389
warn(msg)

0 commit comments

Comments
 (0)