提交 078da5de 编写于 作者: M minqiyang

Remove MAJOR, MINOR, PATCH and add comment for assert

上级 037f9ae9
...@@ -18,7 +18,8 @@ def git_commit(): ...@@ -18,7 +18,8 @@ def git_commit():
return git_commit return git_commit
def _get_version_detail(idx): def _get_version_detail(idx):
assert idx < 3 assert idx < 3, "vesion info consists of %(major)d.%(minor)d.%(patch)d, \
so detail index must less than 3"
version_details = '@PADDLE_VERSION@'.split('.') version_details = '@PADDLE_VERSION@'.split('.')
if len(version_details) == 3: if len(version_details) == 3:
...@@ -32,21 +33,21 @@ def get_major(): ...@@ -32,21 +33,21 @@ def get_major():
if major is not None: if major is not None:
return major return major
return MAJOR return 0
def get_minor(): def get_minor():
minor = _get_version_detail(1) minor = _get_version_detail(1)
if minor is not None: if minor is not None:
return minor return minor
return MINOR return 0
def get_patch(): def get_patch():
patch = _get_version_detail(2) patch = _get_version_detail(2)
if patch is not None: if patch is not None:
return patch return patch
return PATCH return 0
def is_taged(): def is_taged():
try: try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册