fix(shell): check if system is Linux before check for os_release
Why this change ? ================= On Windows or MacOS, Cutekit will crash because it cannot access Linux distro informations available inside of the /etc directory The fix ======= A simple check if the system is Linux should do the job.
This commit is contained in:
parent
220f15008b
commit
5ffa1868e3
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ class Uname:
|
||||||
def uname() -> Uname:
|
def uname() -> Uname:
|
||||||
un = platform.uname()
|
un = platform.uname()
|
||||||
|
|
||||||
if hasattr(platform, "freedesktop_os_release"):
|
if un.system == "Linux" and hasattr(platform, "freedesktop_os_release"):
|
||||||
distrib = platform.freedesktop_os_release()
|
distrib = platform.freedesktop_os_release()
|
||||||
else:
|
else:
|
||||||
distrib = {"NAME": "Unknown"}
|
distrib = {"NAME": "Unknown"}
|
||||||
|
|
Loading…
Reference in a new issue