Skip to content

Commit a2af80a

Browse files
committed
sandboxjs.py: catch subprocess exception
1 parent 79f5d89 commit a2af80a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

cwltool/sandboxjs.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ class JavascriptException(Exception):
2626
def check_js_threshold_version(working_alias):
2727
# type: (str) -> bool
2828
""" parse node version: 'v4.2.6\n' -> ['4', '2', '6'],
29-
https://github.com/nodejs/node/blob/master/CHANGELOG.md#nodejs-changelog """
30-
31-
v1, v2, v3 = [int(v) for v in subprocess.check_output(
32-
[working_alias, "-v"]).decode('ascii').strip().strip('v').split('.')]
29+
https://github.com/nodejs/node/blob/master/CHANGELOG.md#nodejs-changelog"""
30+
31+
try:
32+
v1, v2, v3 = [int(v) for v in subprocess.check_output(
33+
[working_alias, "-v"]).decode('ascii').strip().strip('v').split('.')]
34+
except Exception as e:
35+
_logger.debug(str(e))
36+
_logger.debug("Calling subprocess failed")
37+
return True
3338

3439
if v1 == 0:
3540
if v2 == 10 and v3 <= 25 or v2 < 10:

0 commit comments

Comments
 (0)