Skip to content

Commit 9e75456

Browse files
authored
Edit version control
Raising Exception if Niftyreg not found
1 parent 37411dd commit 9e75456

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nipype/interfaces/niftyreg/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ class NiftyRegCommand(CommandLine):
7272

7373
def __init__(self, required_version=None, **inputs):
7474
super(NiftyRegCommand, self).__init__(**inputs)
75-
cur_version = self.get_version().decode("utf-8")
75+
cur_version = self.get_version()
76+
if not cur_version:
77+
raise Exception('Niftyreg not found')
78+
# Decoding to string:
79+
cur_version = cur_version.decode("utf-8")
7680
if StrictVersion(cur_version) < StrictVersion(self._min_version):
7781
err = 'A later version of Niftyreg is required (%s < %s)'
7882
raise ValueError(err % (cur_version, self._min_version))

0 commit comments

Comments
 (0)