aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-07-31 04:48:43 +0300
committermax99x <max99x@gmail.com>2011-07-31 04:48:43 +0300
commit7f735afe5ee57f693602b661e8e6286dcc914c72 (patch)
treeb2600adf0702544c40453febbf8fd5e09e048102 /emscripten.py
parent4477fc67dea3cf0e6d54f4ae59946a70b069e7ae (diff)
parent3928f293b817a48797faf10b10a69240236de767 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/emscripten.py b/emscripten.py
index b77c361d..022068c8 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -150,13 +150,12 @@ def emscript(infile, settings, outfile):
defined in src/settings.js.
outfile: The file where the output is written.
"""
- data = open(infile, 'r').read()
+ settings_file = get_temp_file('.txt').name # Save settings to a file to work around v8 issue 1579
+ s = open(settings_file, 'w')
+ s.write(settings)
+ s.close()
compiler = path_from_root('src', 'compiler.js')
- subprocess.Popen(shared.COMPILER_ENGINE + [compiler],
- stdin=subprocess.PIPE,
- stdout=outfile,
- cwd=path_from_root('src'),
- stderr=subprocess.STDOUT).communicate(settings + '\n' + data)
+ shared.run_js(shared.COMPILER_ENGINE, compiler, [settings_file, infile], stdout=outfile, stderr=subprocess.STDOUT, cwd=path_from_root('src'))
outfile.close()
@@ -220,7 +219,7 @@ if __name__ == '__main__':
keywords, positional = parser.parse_args()
if len(positional) != 1:
raise RuntimeError('Must provide exactly one positional argument.')
- keywords.infile = positional[0]
+ keywords.infile = os.path.abspath(positional[0])
if isinstance(keywords.outfile, basestring):
keywords.outfile = open(keywords.outfile, 'w')