Skip to content

Commit 6e3f653

Browse files
committed
enh: replace id extraction with regular expression
1 parent ae65bd6 commit 6e3f653

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nipype/pipeline/plugins/sge.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""
33

44
import os
5+
import re
56
import subprocess
67
from time import sleep
78

@@ -109,7 +110,8 @@ def _submit_batchtask(self, scriptfile, node):
109110
iflogger.setLevel(oldlevel)
110111
# retrieve sge taskid
111112
lines = [line for line in result.runtime.stdout.split('\n') if line]
112-
taskid = int(lines[-1].split(' ')[2])
113+
taskid = int(re.match("Your job ([0-9]*) .* has been submitted",
114+
lines[-1]).groups()[0])
113115
self._pending[taskid] = node.output_dir()
114116
logger.debug('submitted sge task: %d for node %s' % (taskid, node._id))
115117
return taskid

0 commit comments

Comments
 (0)