提交 0e3cdab2 authored 作者: Jeremiah Lowin's avatar Jeremiah Lowin

Python3 compatibility in test program compilation

Similar fix to #1660. Without this fix, a `'str' does not support the buffer interface` error is raised in Python 3.3 on Mac OSX 10.9. One place it occurs is during testing for the Mac OS sdot bug (line 73, blas_headers.py)
上级 6253b797
...@@ -1800,6 +1800,11 @@ class GCC_compiler(object): ...@@ -1800,6 +1800,11 @@ class GCC_compiler(object):
fd, path = tempfile.mkstemp(suffix='.c', prefix=tmp_prefix) fd, path = tempfile.mkstemp(suffix='.c', prefix=tmp_prefix)
exe_path = path[:-2] exe_path = path[:-2]
try: 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.write(fd, src_code)
os.close(fd) os.close(fd)
fd = None fd = None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论