Skip to content

Commit 3d070f6

Browse files
committed
nipype_cmd: used str2bool utility method.
1 parent 535f22c commit 3d070f6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nipype/utils/nipype_cmd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import inspect
44
import sys
55
from nipype.interfaces.base import Interface
6-
6+
from nipype.utils.misc import str2bool
77

88
def listClasses(module=None):
99
if module:
@@ -42,11 +42,11 @@ def run_instance(interface, options):
4242
value = float(value)
4343
except:
4444
pass
45-
# try to cast string input to boolean
46-
if value == "true" or value == "True":
47-
value = True
48-
if value == "false" or value == "False":
49-
value = False
45+
#try to cast string input to boolean
46+
try:
47+
value = str2bool(value)
48+
except:
49+
pass
5050
try:
5151
setattr(interface.inputs, input_name,
5252
value)

0 commit comments

Comments
 (0)