From 10879744d04ef81939e474714dac7c836f30005c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 13 Oct 2012 12:37:03 +0200 Subject: fixed JsEngine init --- module/common/JsEngine.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'module/common/JsEngine.py') diff --git a/module/common/JsEngine.py b/module/common/JsEngine.py index 38c2b291d..ef7494d16 100644 --- a/module/common/JsEngine.py +++ b/module/common/JsEngine.py @@ -55,14 +55,17 @@ if not ENGINE or DEBUG: pass if not ENGINE or DEBUG: - import subprocess - subprocess.Popen(["node", "-v"], bufsize=-1, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() - p = subprocess.Popen(["node", "-e", "console.log(23+19)"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() - #integrity check - if out.strip() == "42": - ENGINE = "node" - NODE = True + try: + import subprocess + subprocess.Popen(["node", "-v"], bufsize=-1, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + p = subprocess.Popen(["node", "-e", "console.log(23+19)"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + #integrity check + if out.strip() == "42": + ENGINE = "node" + NODE = True + except: + pass if not ENGINE or DEBUG: try: -- cgit v1.2.3