fixed crash on reading broken Xorg log

master 3.7.1.18
idziubenko 3 years ago
parent b41c497efb
commit 73a6fae253

@ -306,9 +306,12 @@ def getVideoFromXorgLog(prefix="/", available_drivers=()):
xorg_log_file = path.join(prefix, 'var/log/Xorg.%s.log' %
display_number.group(1))
if path.exists(xorg_log_file):
matchStrs = [x.group(1) for x in [reDriverName.search(y)
for y in readLinesFile(xorg_log_file)
if "drv" in y and reDriver.search(y)] if x]
try:
matchStrs = [x.group(1) for x in [reDriverName.search(y)
for y in readLinesFile(xorg_log_file)
if "drv" in y and reDriver.search(y)] if x]
except UnicodeDecodeError as e:
return ""
if matchStrs:
reUnload = re.compile('UnloadModule: "(%s)"' %'|'.join(x
for x in matchStrs))

Loading…
Cancel
Save