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

Merge pull request #1721 from jlowin/patch-1

Python3 compatibility in test program compilation
......@@ -1800,6 +1800,11 @@ class GCC_compiler(object):
fd, path = tempfile.mkstemp(suffix='.c', prefix=tmp_prefix)
exe_path = path[:-2]
try:
# Python3 compatibility: try to cast Py3 strings as Py2 strings
try:
src_code = b(src_code)
except:
pass
os.write(fd, src_code)
os.close(fd)
fd = None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论