Skip to content

Commit 09f325a

Browse files
authored
Merge pull request #2792 from oesteban/maint/use-has_traits
[MAINT] DeprecationWarning: use ``HasTraits.trait_set`` instead
2 parents 27490e6 + aad991d commit 09f325a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

nipype/pipeline/engine/utils.py

+7-4
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.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.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.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)