Handle IOError exception if no /etc/os-release

On Synology DSM OS (Linux base), python throws an IOError when open does not find a file.
Previously only OSError was handled, now it handles both the OSError and IOError.
This commit is contained in:
Jean-Christophe 2014-12-15 15:52:33 +01:00 committed by Alessio Sergi
parent d17def69b4
commit 4f7773e3a8

View File

@ -80,7 +80,7 @@ class Plugin(GlancesPlugin):
for key in keys:
if line.startswith(key):
ashtray[key] = line.strip().split('=')[1][1:-1]
except OSError:
except (OSError, IOError):
return pretty_name
if ashtray: