Skip to content

Commit a72c9f5

Browse files
committed
Fix About error with platform setting
1 parent 21e8d1d commit a72c9f5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/windows/settings.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,20 @@ def __init__(self):
128128
self.label = T(32410, 'Platform Version')
129129

130130
def valueLabel(self):
131+
plat = None
131132
try:
132133
import platform
133-
dist = platform. dist()
134-
if dist and len(dist) > 1:
135-
plat = u'{0} {1}'.format(dist[0], dist[1])
134+
release = platform.freedesktop_os_release()
135+
if release and release.get("PRETTY_NAME"):
136+
plat = release["PRETTY_NAME"]
136137
else:
137138
plat = platform.platform()
138139
plat = u'{0} {1}'.format(plat[0], '.'.join(plat[1].split('.', 2)[:2]))
140+
141+
plat = plat.strip()
139142
except:
140143
util.ERROR()
141144

142-
plat = plat.strip()
143-
144145
if not plat:
145146
if xbmc.getCondVisibility('System.Platform.Android'):
146147
plat = 'Android'

0 commit comments

Comments
 (0)