Skip to content

Commit d5b19d1

Browse files
committed
Added support for non standard return codes. For example when a non zero
code is returned but the program has run successfully.
1 parent 3bf6539 commit d5b19d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nipype/interfaces/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ def version_from_command(self, flag='-v'):
12441244
o, e = proc.communicate()
12451245
return o
12461246

1247-
def _run_interface(self, runtime):
1247+
def _run_interface(self, runtime, correct_return_codes = [0]):
12481248
"""Execute command via subprocess
12491249
12501250
Parameters
@@ -1265,7 +1265,7 @@ def _run_interface(self, runtime):
12651265
raise IOError("%s could not be found on host %s" % (self.cmd.split()[0],
12661266
runtime.hostname))
12671267
runtime = run_command(runtime, output=self.inputs.terminal_output)
1268-
if runtime.returncode is None or runtime.returncode != 0:
1268+
if runtime.returncode is None or runtime.returncode not in correct_return_codes:
12691269
self.raise_exception(runtime)
12701270

12711271
return runtime

0 commit comments

Comments
 (0)