Skip to content

Commit 2cf675f

Browse files
committed
Save full version string, derive on demand
1 parent 61cc7a9 commit 2cf675f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

nipype/interfaces/ants/base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ def version(self):
4848

4949
for line in res.splitlines():
5050
if line.startswith('ANTs Version: '):
51-
v_string, githash = line.split()[2].split('-')
51+
self._version = line.split()[2]
5252
break
5353
else:
5454
return None
5555

56-
# 2.2.0-equivalent version string
57-
if 'post' in v_string and LooseVersion(v_string) >= LooseVersion('2.1.0.post789'):
58-
self._version = '2.2.0'
59-
else:
60-
self._version = '.'.join(v_string.split('.')[:3])
56+
v_string, githash = self._version.split('-')
6157

62-
return self._version
58+
# 2.2.0-equivalent version string
59+
if 'post' in v_string and LooseVersion(v_string) >= LooseVersion('2.1.0.post789'):
60+
return '2.2.0'
61+
else:
62+
return '.'.join(v_string.split('.')[:3])
6363

6464

6565
class ANTSCommandInputSpec(CommandLineInputSpec):

0 commit comments

Comments
 (0)