mirror of
https://github.com/snowykami/server-status-client.git
synced 2024-11-29 08:45:23 +08:00
✨ 修复部分linux获取发行版错误的问题
This commit is contained in:
parent
8e2c5c24b8
commit
9160e7c4b4
@ -19,9 +19,9 @@ try:
|
||||
# 找到NAME=和VERSION=的行
|
||||
for line in os_release.split("\n"):
|
||||
if line.startswith("NAME="):
|
||||
os_name = line.split("=")[1]
|
||||
os_name = line.split("=")[1].replace('"', '')
|
||||
elif line.startswith("VERSION="):
|
||||
os_version = line.split("=")[1]
|
||||
os_version = line.split("=")[1].replace('"', '')
|
||||
except FileNotFoundError:
|
||||
os_name = platform.system()
|
||||
os_version = platform.release()
|
||||
|
Loading…
Reference in New Issue
Block a user