summaryrefslogtreecommitdiff
path: root/support/lib/util.py
diff options
context:
space:
mode:
authorMichael Schwarz <michi.schwarz@gmail.com>2015-09-11 22:03:03 +0200
committerMichael Schwarz <michi.schwarz@gmail.com>2015-09-16 01:50:23 +0200
commit93f96964914ae30686d30e5667bff92f2d17b791 (patch)
tree60cd3f1f3df32911818f9d9ae2519564b3e55528 /support/lib/util.py
parent0c5b944686a8f7f11461faece073607ff0a41c8a (diff)
downloadpogojig-93f96964914ae30686d30e5667bff92f2d17b791.tar.gz
pogojig-93f96964914ae30686d30e5667bff92f2d17b791.tar.bz2
pogojig-93f96964914ae30686d30e5667bff92f2d17b791.zip
Check for Asymptote not writing a PDF file.
If no drawing commands are called in an Asymptote script, no PDF output is created and no error is generated. This confuses the build process, which expect a target to exist after its commands were called. With this change, the Python wrapper checks whether a PDF was actually written and throws an error otherwise.
Diffstat (limited to 'support/lib/util.py')
-rw-r--r--support/lib/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/support/lib/util.py b/support/lib/util.py
index 915e33c..e343b73 100644
--- a/support/lib/util.py
+++ b/support/lib/util.py
@@ -35,7 +35,7 @@ def TemporaryDirectory():
shutil.rmtree(dir)
-def command(args, remove_env = [], set_env = { }):
+def command(args, remove_env = [], set_env = { }, working_dir = None):
env = dict(os.environ)
for i in remove_env:
@@ -45,7 +45,7 @@ def command(args, remove_env = [], set_env = { }):
env[k] = v
try:
- process = subprocess.Popen(args, env = env)
+ process = subprocess.Popen(args, env = env, cwd = working_dir)
process.wait()
except OSError as e:
raise UserError('Error running {}: {}', args[0], e)