提交 f392dbf4 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #2302 from abergeron/try_flags_cleanup

Make sure we remove the exe_path even if try_run is False in GCC_compiler.try_compile_tmp().
...@@ -1837,19 +1837,15 @@ class GCC_compiler(object): ...@@ -1837,19 +1837,15 @@ class GCC_compiler(object):
if p_ret != 0: if p_ret != 0:
compilation_ok = False compilation_ok = False
elif try_run: elif try_run:
# Try to execute the program out, err, p_ret = output_subprocess_Popen([exe_path])
try: run_ok = (p_ret == 0)
out, err, p_ret = output_subprocess_Popen([exe_path])
run_ok = (p_ret == 0)
finally:
os.remove(exe_path)
finally: finally:
try: try:
if fd is not None: if fd is not None:
os.close(fd) os.close(fd)
finally: finally:
os.remove(path) os.remove(path)
os.remove(exe_path)
except OSError, e: except OSError, e:
compilation_ok = False compilation_ok = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论