summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--support/lib/util.py13
-rw-r--r--support/openscad/__main__.py2
2 files changed, 12 insertions, 3 deletions
diff --git a/support/lib/util.py b/support/lib/util.py
index 8b65e58..45ecb89 100644
--- a/support/lib/util.py
+++ b/support/lib/util.py
@@ -15,8 +15,17 @@ def TemporaryDirectory():
shutil.rmtree(dir)
-def command(args):
- process = subprocess.Popen(args)
+def command(args, remove_env = None):
+ if remove_env is None:
+ env = None
+ else:
+ env = dict(os.environ)
+
+ for i in remove_env:
+ if i in env:
+ del env[i]
+
+ process = subprocess.Popen(args, env = env)
process.wait()
if process.returncode:
diff --git a/support/openscad/__main__.py b/support/openscad/__main__.py
index bc1135d..2042a65 100644
--- a/support/openscad/__main__.py
+++ b/support/openscad/__main__.py
@@ -32,7 +32,7 @@ def main(in_path, out_path, deps_path):
# Use make to parse the dependency makefile written by OpenSCAD.
util.write_file(temp_mk_path, mk_content.encode())
- util.command(['make', '-s', '-B', '-f', temp_mk_path, '-f', temp_deps_path])
+ util.command(['make', '-s', '-B', '-f', temp_mk_path, '-f', temp_deps_path], remove_env = ['MAKELEVEL', 'MAKEFLAGS'])
# All dependencies as paths relative to the project root.
deps = set(map(relpath, util.read_file(temp_files_path).decode().splitlines()))