Skip to content

Commit 6ceb87e

Browse files
alexsavioBen Cipollini
authored andcommitted
fix: interfaces/utility.py: remove dumps and loads
1 parent 291aaf2 commit 6ceb87e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nipype/interfaces/utility.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
from pickle import dumps
21+
from textwrap import dedent
2122
import numpy as np
2223
import nibabel as nb
2324

@@ -407,7 +408,7 @@ def __init__(self, input_names, output_names, function=None, imports=None,
407408
'function objects defined interactively ' \
408409
'in a python session')
409410
elif isinstance(function, str):
410-
self.inputs.function_str = dumps(function)
411+
self.inputs.function_str = function
411412
else:
412413
raise Exception('Unknown type of function')
413414
self.inputs.on_trait_change(self._set_function_string,
@@ -425,7 +426,7 @@ def _set_function_string(self, obj, name, old, new):
425426
if hasattr(new, '__call__'):
426427
function_source = getsource(new)
427428
elif isinstance(new, str):
428-
function_source = dumps(new)
429+
function_source = new
429430
self.inputs.trait_set(trait_change_notify=False,
430431
**{'%s' % name: function_source})
431432

0 commit comments

Comments
 (0)