Commit 76da0626 by David Trowbridge

Merge pull request #541 from davidt/compiler-stdout-unbound

Fix an UnboundLocalError if a compiler fails.
parents 0db06ec1 d0d53a4e
......@@ -111,6 +111,7 @@ class SubProcessCompiler(CompilerBase):
else:
argument_list.extend(flattening_arg)
stdout = None
try:
# We always catch stdout in a file, but we may not have a use for it.
temp_file_container = cwd or os.path.dirname(stdout_captured or "") or os.getcwd()
......@@ -135,6 +136,7 @@ class SubProcessCompiler(CompilerBase):
raise CompilerError(e)
finally:
# Decide what to do with captured stdout.
if stdout:
if stdout_captured:
os.rename(stdout.name, os.path.join(cwd or os.curdir, stdout_captured))
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment