aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemscripten.py10
-rw-r--r--tools/shared.py10
2 files changed, 8 insertions, 12 deletions
diff --git a/emscripten.py b/emscripten.py
index 06ed063e..f709821e 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -11,7 +11,7 @@ headers, for the libc implementation in JS).
import os, sys, json, optparse, subprocess, re, time, multiprocessing, functools
-from tools import shared, jsrun, cache as cache_module
+from tools import shared, jsrun, cache as cache_module, tempfiles
__rootpath__ = os.path.abspath(os.path.dirname(__file__))
def path_from_root(*pathelems):
@@ -45,7 +45,7 @@ def process_funcs((i, funcs, meta, settings_file, compiler, forwarded_file, libr
args=[settings_file, funcs_file, 'funcs', forwarded_file] + libraries,
stdout=subprocess.PIPE,
cwd=path_from_root('src'))
- shared.try_delete(funcs_file)
+ tempfiles.try_delete(funcs_file)
return out
def emscript(configuration, infile, settings, outfile, libraries=[], compiler_engine=None,
@@ -596,7 +596,7 @@ def _main(environ):
default=sys.stdout,
help='Where to write the output; defaults to stdout.')
parser.add_option('-c', '--compiler',
- default=shared.COMPILER_ENGINE,
+ default=None,
help='Which JS engine to use to run the compiler; defaults to the one in ~/.emscripten.')
parser.add_option('--relooper',
default=None,
@@ -640,6 +640,10 @@ WARNING: You should normally never use this! Use emcc instead.
temp_files = configuration.get_temp_files()
+ if keywords.compiler is None:
+ from tools import shared
+ keywords.compiler = shared.COMPILER_ENGINE
+
cache = cache_module.Cache()
temp_files.run_and_clean(lambda: main(
keywords,
diff --git a/tools/shared.py b/tools/shared.py
index f0c79dae..052be15b 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -460,15 +460,7 @@ if not WINDOWS:
pass
# Temp file utilities
-
-def try_delete(filename):
- try:
- os.unlink(filename)
- except:
- try:
- shutil.rmtree(filename)
- except:
- pass
+from .tempfiles import try_delete
# Utilities