use distro in place of deprecated dist() method

This commit is contained in:
Damien Elmes 2019-03-04 15:39:10 +10:00
parent e91901911f
commit ef23268573
2 changed files with 4 additions and 2 deletions

View File

@ -388,8 +388,9 @@ def platDesc():
elif isWin: elif isWin:
theos = "win:%s" % (platform.win32_ver()[0]) theos = "win:%s" % (platform.win32_ver()[0])
elif system == "Linux": elif system == "Linux":
dist = platform.dist() import distro
theos = "lin:%s:%s" % (dist[0], dist[1]) r = distro.linux_distribution(full_distribution_name=False)
theos = "lin:%s:%s" % (r[0], r[1])
else: else:
theos = system theos = system
break break

View File

@ -5,3 +5,4 @@ requests
decorator decorator
markdown markdown
psutil; sys_platform == "win32" psutil; sys_platform == "win32"
distro; sys_platform != "win32" and sys_platform != "darwin"