Skip to content

Commit a4a9dc1

Browse files
committed
PY3: Use func.__code__
1 parent 3d71c04 commit a4a9dc1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nipype/interfaces/utility/wrappers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ def __init__(self, input_names=None, output_names='out', function=None,
9090
'in a python session')
9191
else:
9292
if input_names is None:
93-
fninfo = function.func_code
93+
fninfo = function.__code__
9494
elif isinstance(function, (str, bytes)):
9595
self.inputs.function_str = function
9696
if input_names is None:
9797
fninfo = create_function_from_source(
98-
function, imports).func_code
98+
function, imports).__code__
9999
else:
100100
raise Exception('Unknown type of function')
101101
if input_names is None:
@@ -114,11 +114,11 @@ def _set_function_string(self, obj, name, old, new):
114114
if name == 'function_str':
115115
if hasattr(new, '__call__'):
116116
function_source = getsource(new)
117-
fninfo = new.func_code
117+
fninfo = new.__code__
118118
elif isinstance(new, (str, bytes)):
119119
function_source = new
120120
fninfo = create_function_from_source(
121-
new, self.imports).func_code
121+
new, self.imports).__code__
122122
self.inputs.trait_set(trait_change_notify=False,
123123
**{'%s' % name: function_source})
124124
# Update input traits

0 commit comments

Comments
 (0)