[scripts/welcome] script crash on Python 3.9 on macOS

This commit is contained in:
Dmytro Meleshko 2020-11-07 23:07:27 +02:00
parent 6ed0ea251c
commit 265eaa565b

View file

@ -188,9 +188,10 @@ def _get_distro_info():
if psutil.WINDOWS: if psutil.WINDOWS:
return "windows", platform.system(), platform.release(), "" return "windows", platform.system(), platform.release(), ""
elif psutil.OSX: elif psutil.OSX:
from plistlib import readPlist import plistlib
sw_vers = readPlist("/System/Library/CoreServices/SystemVersion.plist") with open("/System/Library/CoreServices/SystemVersion.plist", "rb") as f:
sw_vers = plistlib.load(f)
return "mac", sw_vers["ProductName"], sw_vers["ProductVersion"], "" return "mac", sw_vers["ProductName"], sw_vers["ProductVersion"], ""
elif _is_android(): elif _is_android():
from subprocess import check_output from subprocess import check_output