Skip to content

Commit 5500598

Browse files
committed
More robust version string finding
1 parent a244471 commit 5500598

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nipype/interfaces/ants/base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ def version(self):
4646
except OSError:
4747
return None
4848

49-
v_string = res.splitlines()[0].split(': ')[1]
49+
for line in res.splitlines():
50+
if line.startswith('ANTs Version: '):
51+
v_string = line.split()[2]
52+
break
53+
else:
54+
return None
55+
5056
# 2.2.0-equivalent version string
5157
if LooseVersion(v_string) >= LooseVersion('2.1.0.post789-g0740f'):
5258
self._version = '2.2.0'

0 commit comments

Comments
 (0)