Skip to content

Commit 7df2d62

Browse files
matteomancinieffigies
authored andcommitted
Added if statement to correctly handle strings and list during export.
1 parent 6566e6e commit 7df2d62

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

nipype/pipeline/engine/utils.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,15 @@ def format_node(node, format="python", include_config=False):
369369
filled_args = []
370370
for arg in args:
371371
if hasattr(node.interface, "_%s" % arg):
372-
filled_args.append(
373-
"%s=%s" % (arg, getattr(node.interface, "_%s" % arg))
374-
)
372+
argval = getattr(node.interface, "_%s" % arg)
373+
if isinstance(argval, str):
374+
filled_args.append(
375+
"%s='%s'" % (arg, argval)
376+
)
377+
else:
378+
filled_args.append(
379+
"%s=%s" % (arg, argval)
380+
)
375381
args = ", ".join(filled_args)
376382
else:
377383
args = ""

0 commit comments

Comments
 (0)