From 5a1604ce202077da2823bf63f4400dd9343a17df Mon Sep 17 00:00:00 2001 From: Michael Schwarz Date: Thu, 6 Aug 2015 16:32:35 +0200 Subject: Use Python script to run Asymptote. --- support/lib/util.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'support/lib') diff --git a/support/lib/util.py b/support/lib/util.py index 3c5117d..54b92f0 100644 --- a/support/lib/util.py +++ b/support/lib/util.py @@ -27,15 +27,14 @@ def TemporaryDirectory(): shutil.rmtree(dir) -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] +def command(args, remove_env = [], set_env = { }): + env = dict(os.environ) + + for i in remove_env: + del env[i] + + for k, v in set_env.items(): + env[k] = v process = subprocess.Popen(args, env = env) process.wait() -- cgit