Skip to content

Commit 3cf2435

Browse files
committed
enh: allow boolean traits to be set to False
1 parent 5e03d93 commit 3cf2435

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

nipype/interfaces/base.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,14 +1138,7 @@ def _format_arg(self, name, trait_spec, value):
11381138
# if True.
11391139
return argstr
11401140
else:
1141-
# If we end up here we're trying to add a Boolean to
1142-
# the arg string but whose value is False. This
1143-
# should not happen, something went wrong upstream.
1144-
# Raise an error.
1145-
msg = "Object '%s' attempting to format argument " \
1146-
"string for attr '%s' with value '%s'." \
1147-
% (self, trait_spec.name, value)
1148-
raise ValueError(msg)
1141+
return None
11491142
#traits.Either turns into traits.TraitCompound and does not have any inner_traits
11501143
elif trait_spec.is_trait_type(traits.List) \
11511144
or (trait_spec.is_trait_type(traits.TraitCompound) \
@@ -1201,6 +1194,8 @@ def _parse_inputs(self, skip=None):
12011194
else:
12021195
continue
12031196
arg = self._format_arg(name, spec, value)
1197+
if arg is None:
1198+
continue
12041199
pos = spec.position
12051200
if pos is not None:
12061201
if pos >= 0:

0 commit comments

Comments
 (0)