Skip to content

Commit 97ca15d

Browse files
committed
Fix input type description in Interface.help()
Fixes #1000 I didn't think this would be so easy.
1 parent f7558b9 commit 97ca15d

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

nipype/interfaces/base.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -757,17 +757,12 @@ def _get_trait_desc(self, inputs, name, spec):
757757

758758
manhelpstr = ['\t%s' % name]
759759

760-
try:
761-
setattr(inputs, name, None)
762-
except TraitError as excp:
763-
def_val = ''
764-
if getattr(spec, 'usedefault'):
765-
def_arg = getattr(spec, 'default_value')()[1]
766-
def_val = ', nipype default value: %s' % str(def_arg)
767-
line = "(%s%s)" % (excp.info, def_val)
768-
manhelpstr = wrap(line, 70,
769-
initial_indent=manhelpstr[0]+': ',
770-
subsequent_indent='\t\t ')
760+
type_info = spec.full_info(inputs, name, None)
761+
default = ', nipype default value: %s' % spec.default_value()[1]
762+
line = "(%s%s)" % (type_info, default if spec.usedefault else '')
763+
manhelpstr = wrap(line, 70,
764+
initial_indent=manhelpstr[0]+': ',
765+
subsequent_indent='\t\t ')
771766

772767
if desc:
773768
for line in desc.split('\n'):

0 commit comments

Comments
 (0)