Skip to content

Commit a60eb4e

Browse files
d-vogeleffigies
andauthored
Rather remove the newlines than trim the last char of the template.
As per @effigies suggestion. Co-authored-by: Chris Markiewicz <[email protected]>
1 parent 5916043 commit a60eb4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nipype/pipeline/plugins/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,9 @@ def _submit_job(self, node, updatehash=False):
543543
pyscript = create_pyscript(node, updatehash=updatehash)
544544
batch_dir, name = os.path.split(pyscript)
545545
name = ".".join(name.split(".")[:-1])
546-
batchscript = "\n".join((self._template[:-1], "%s %s" % (sys.executable, pyscript)))
546+
batchscript = "\n".join(
547+
(self._template.rstrip("\n"), "%s %s" % (sys.executable, pyscript))
548+
)
547549
batchscriptfile = os.path.join(batch_dir, "batchscript_%s.sh" % name)
548550
with open(batchscriptfile, "wt") as fp:
549551
fp.writelines(batchscript)

0 commit comments

Comments
 (0)