提交 4dfd1f0a authored 作者: James Bergstra's avatar James Bergstra

when compilation fails, the source is printed with line numbers to stderr

上级 57569e64
......@@ -547,6 +547,11 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[]
status = p.wait()
if status:
print '==============================='
for i, l in enumerate(src_code.split('\n')):
#gcc put its messages to stderr, so we add ours now
print >> sys.stderr, '%05i\t%s'%(i+1, l)
print '==============================='
raise Exception('g++ return status', status)
#touch the __init__ file
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论