Skip to content

Commit aad991d

Browse files
committed
fixed
1 parent b8f30d2 commit aad991d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

nipype/pipeline/engine/utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,15 @@ def save_resultfile(result, cwd, name):
304304
tosave = _uncollapse(outputs.copy(), collapsed)
305305
except AttributeError:
306306
tosave = outputs = result.outputs.dictcopy() # outputs was a bunch
307-
result.outputs.trait_set(**modify_paths(tosave, relative=True, basedir=cwd))
307+
for k, v in list(modify_paths(tosave, relative=True, basedir=cwd).items()):
308+
setattr(result.outputs, k, v)
308309

309310
savepkl(resultsfile, result)
310311
logger.debug('saved results in %s', resultsfile)
311312

312313
if result.outputs:
313-
result.outputs.trait_set(**outputs)
314+
for k, v in list(outputs.items()):
315+
setattr(result.outputs, k, v)
314316

315317

316318
def load_resultfile(path, name):
@@ -360,8 +362,9 @@ def load_resultfile(path, name):
360362
except AttributeError:
361363
outputs = result.outputs.dictcopy() # outputs == Bunch
362364
try:
363-
result.outputs.trait_set(
364-
**modify_paths(outputs, relative=False, basedir=path))
365+
for k, v in list(modify_paths(outputs, relative=False,
366+
basedir=path).items()):
367+
setattr(result.outputs, k, v)
365368
except FileNotFoundError:
366369
logger.debug('conversion to full path results in '
367370
'non existent file')

0 commit comments

Comments
 (0)