Skip to content

Commit 2ab6d27

Browse files
committed
* 优化获取版本信息的方法
1 parent 0d9774c commit 2ab6d27

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ def write_version(package_name):
1313
def get_app_version():
1414
try:
1515
with open("CONTRIBUTING.md","rb") as f:
16-
content = str(f.read(),encoding="utf-8").split("#### ")[1].split(" - ")[0]
17-
version = ""
16+
content = str(f.read(),encoding="utf-8").split(" - ")[0].split("#")[-1].strip()
1817
if "v" in content and "V" in content:
1918
version = content.split("V")[-1]
2019
elif "v" in content:

0 commit comments

Comments
 (0)