Skip to content

Commit 95ceb2a

Browse files
committed
Merge pull request #572 from chrisfilo/enh/non_standard_return_codes
non standard return codes
2 parents f87c476 + 4eb817f commit 95ceb2a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

nipype/interfaces/ants/resampling.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ def _list_outputs(self):
9999
self.inputs.out_postfix,
100100
ext)))
101101
return outputs
102+
103+
def _run_interface(self, runtime):
104+
runtime = super(WarpTimeSeriesImageMultiTransform, self)._run_interface(runtime, correct_return_codes = [0,1])
105+
if "100 % complete" not in runtime.stdout:
106+
self.raise_exception(runtime)
107+
return runtime
102108

103109

104110
class WarpImageMultiTransformInputSpec(ANTSCommandInputSpec):

nipype/interfaces/base.py

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

1250-
def _run_interface(self, runtime):
1250+
def _run_interface(self, runtime, correct_return_codes = [0]):
12511251
"""Execute command via subprocess
12521252
12531253
Parameters
@@ -1268,7 +1268,7 @@ def _run_interface(self, runtime):
12681268
raise IOError("%s could not be found on host %s" % (self.cmd.split()[0],
12691269
runtime.hostname))
12701270
runtime = run_command(runtime, output=self.inputs.terminal_output)
1271-
if runtime.returncode is None or runtime.returncode != 0:
1271+
if runtime.returncode is None or runtime.returncode not in correct_return_codes:
12721272
self.raise_exception(runtime)
12731273

12741274
return runtime

0 commit comments

Comments
 (0)