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