Skip to content

Commit 1e3a5a2

Browse files
committed
suppress printing of empty javascript console output
1 parent 7df1d24 commit 1e3a5a2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cwltool/sandboxjs.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,11 @@ def stdfmt(data): # type: (unicode) -> unicode
194194
nodejs.poll()
195195

196196
if js_console:
197-
print("Javascript console output:")
198-
print("----------------------------------------")
199-
print('\n'.join(re.findall(r'^[[](?:log|err)[]].*$', stderrdata, flags=re.MULTILINE)))
200-
print("----------------------------------------")
197+
if len(stderrdata) > 0:
198+
print("Javascript console output:")
199+
print("----------------------------------------")
200+
print('\n'.join(re.findall(r'^[[](?:log|err)[]].*$', stderrdata, flags=re.MULTILINE)))
201+
print("----------------------------------------")
201202

202203
if debug:
203204
info = u"returncode was: %s\nscript was:\n%s\nstdout was: %s\nstderr was: %s\n" %\

0 commit comments

Comments
 (0)