未验证 提交 bda59b1b 编写于 作者: Y YUNSHEN XIE 提交者: GitHub

fix setup.py (#50800)

上级 363825df
...@@ -43,10 +43,17 @@ else: ...@@ -43,10 +43,17 @@ else:
python_version = platform.python_version() python_version = platform.python_version()
os.environ["PY_VERSION"] = python_version os.environ["PY_VERSION"] = python_version
else: else:
if os.getenv("PY_VERSION") != platform.python_version()[:3]: if os.getenv("PY_VERSION") != str(sys.version_info.major) + '.' + str(
sys.version_info.minor
):
raise RuntimeError( raise RuntimeError(
"You set PY_VERSION=%s, but your current python environment is %s, you should keep them consistent!" "You set PY_VERSION=%s, but your current python environment is %s, you should keep them consistent!"
% (os.getenv("PY_VERSION"), platform.python_version()[:3]) % (
os.getenv("PY_VERSION"),
str(sys.version_info.major)
+ '.'
+ str(sys.version_info.minor),
)
) )
# check cmake # check cmake
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册