提交 e4275e8b authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Moved call to communicate() into try block

This may catch more errors.
上级 543fca03
...@@ -1392,12 +1392,12 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[] ...@@ -1392,12 +1392,12 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[]
try: try:
p = subprocess.Popen(cmd, stderr=subprocess.PIPE) p = subprocess.Popen(cmd, stderr=subprocess.PIPE)
compile_stderr = p.communicate()[1]
except Exception: except Exception:
# An exception can occur here e.g. if `g++` is not found. # An exception can occur e.g. if `g++` is not found.
print_command_line_error() print_command_line_error()
raise raise
compile_stderr = p.communicate()[1]
status = p.returncode status = p.returncode
if status: if status:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论