Skip to content

Commit

Permalink
Merge pull request #84 from Qi-Cao/main
Browse files Browse the repository at this point in the history
修复关于启动ncatbot时提示NoneType的问题,版本更新至3.1.4
  • Loading branch information
Qi-Cao authored Feb 19, 2025
2 parents 974c61e + f0e18b9 commit 0017085
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ncatbot/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.1.3"
__version__ = "3.1.4"
4 changes: 3 additions & 1 deletion ncatbot/utils/check_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ def get_local_package_version(package_name):
:return: 本地版本(字符串)或 None(如果包未安装)
"""
try:
# 改用 python -m pip
# 改用 python -m pip,并添加encoding参数
result = subprocess.run(
[sys.executable, "-m", "pip", "show", package_name],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
encoding="utf-8",
check=True
)
# 如果命令成功执行,结果包含包的版本信息
for line in result.stdout.splitlines():
Expand Down

0 comments on commit 0017085

Please sign in to comment.