File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -39,37 +39,39 @@ def get_os_info():
3939 """
4040 os_name = ""
4141 os_version = ""
42-
43- if sys .platform .startswith ("win" ):
42+
43+ platform_name = sys .platform
44+
45+ if platform_name .startswith ("win" ):
4446 os_name = "Windows"
4547 if hasattr (platform , "win32_ver" ):
4648 win_version = platform .win32_ver ()[0 ]
4749 if win_version :
4850 os_version = win_version
49-
50- elif sys . platform == "darwin" :
51+
52+ elif platform_name == "darwin" :
5153 os_name = "Mac OS X"
5254 if hasattr (platform , "mac_ver" ):
5355 mac_version = platform .mac_ver ()[0 ]
5456 if mac_version :
5557 os_version = mac_version
56-
57- elif sys . platform .startswith ("linux" ):
58+
59+ elif platform_name .startswith ("linux" ):
5860 os_name = "Linux"
5961 linux_info = distro .info ()
6062 if linux_info ["version" ]:
6163 os_version = linux_info ["version" ]
62-
63- elif sys . platform .startswith ("freebsd" ):
64+
65+ elif platform_name .startswith ("freebsd" ):
6466 os_name = "FreeBSD"
6567 if hasattr (platform , "release" ):
6668 os_version = platform .release ()
67-
69+
6870 else :
69- os_name = sys . platform
71+ os_name = platform_name
7072 if hasattr (platform , "release" ):
7173 os_version = platform .release ()
72-
74+
7375 return os_name , os_version
7476
7577
You can’t perform that action at this time.
0 commit comments