aboutsummaryrefslogtreecommitdiff
path: root/tools/jsrun.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/jsrun.py')
-rw-r--r--tools/jsrun.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/jsrun.py b/tools/jsrun.py
index 571e9cee..6f77ce51 100644
--- a/tools/jsrun.py
+++ b/tools/jsrun.py
@@ -10,15 +10,17 @@ def timeout_run(proc, timeout, note='unnamed process', full_output=False):
proc.kill() # XXX bug: killing emscripten.py does not kill it's child process!
raise Exception("Timed out: " + note)
out = proc.communicate()
+ out = map(lambda o: '' if o is None else o, out)
return '\n'.join(out) if full_output else out[0]
-def run_js(filename, engine=None, args=[], check_timeout=False, stdout=PIPE, stderr=None, cwd=None, full_output=False):
+def run_js(filename, engine=None, args=[], check_timeout=False, stdin=None, stdout=PIPE, stderr=None, cwd=None, full_output=False):
if type(engine) is not list:
engine = [engine]
command = engine + [filename] + (['--'] if 'd8' in engine[0] or 'jsc' in engine[0] else []) + args
return timeout_run(
Popen(
command,
+ stdin=stdin,
stdout=stdout,
stderr=stderr,
cwd=cwd),