提交 83df68c5 authored 作者: George Ho's avatar George Ho

Always convert string to bytes

上级 e180a8d9
...@@ -1878,11 +1878,7 @@ class Compiler: ...@@ -1878,11 +1878,7 @@ class Compiler:
path = '"' + path + '"' path = '"' + path + '"'
exe_path = '"' + exe_path + '"' exe_path = '"' + exe_path + '"'
try: try:
# Python3 compatibility: try to cast Py3 strings as Py2 strings src_code = src_code.encode() # Convert string to bytes
try:
src_code = b(src_code)
except Exception:
pass
os.write(fd, src_code) os.write(fd, src_code)
os.close(fd) os.close(fd)
fd = None fd = None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论