提交 4ad9b755 编写于 作者: Z zhongpu 提交者: hong

fix paddle compile errors under some python versions (#21616)

* fix compile error in some python version, test=develop

* remove redudant code, test=develop
上级 be6a6396
......@@ -370,11 +370,13 @@ class InstallHeaders(Command):
if sys.platform != 'win32':
@contextmanager
def redirect_stdout():
with open('${SETUP_LOG_FILE}', 'w') as f:
origin_stdout = sys.stdout
sys.stdout = f
yield
sys.stdout = origin_stdout
f_log = open('${SETUP_LOG_FILE}', 'w')
origin_stdout = sys.stdout
sys.stdout = f_log
yield
f_log = sys.stdout
sys.stdout = origin_stdout
f_log.close()
else:
@contextmanager
def redirect_stdout():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册