mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-08 02:58:56 +03:00
Correct issue with Error management
This commit is contained in:
parent
f4873cef08
commit
dc49b12307
@ -11,6 +11,7 @@
|
||||
|
||||
from glances.logger import logger
|
||||
from glances.timer import Timer
|
||||
from glances.compat import FileNotFoundError, PermissionError
|
||||
|
||||
import psutil
|
||||
|
||||
@ -77,7 +78,7 @@ class CpuPercent(object):
|
||||
# @TODO: Multisystem...
|
||||
try:
|
||||
self.cpu_info['cpu_name'] = open('/proc/cpuinfo', 'r').readlines()[4].split(':')[1].strip()
|
||||
except (FileNotFoundError, PermissionError, IOError, IndexError, KeyError, AttributeError):
|
||||
except (FileNotFoundError, PermissionError, IndexError, KeyError, AttributeError):
|
||||
self.cpu_info['cpu_name'] = 'CPU'
|
||||
return self.cpu_info['cpu_name']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user