fix on macOS when value is NoneType when compute the max values

pull/1236/head
Tieu-Philippe KHIM 2018-02-12 23:25:56 +01:00
parent 91647bb5d1
commit d9c9cfe911
1 changed files with 2 additions and 1 deletions

View File

@ -359,7 +359,8 @@ class GlancesProcesses(object):
# Compute the maximum value for keys in self._max_values_list (CPU, MEM)
for k in self._max_values_list:
if self.processlist != []:
self.set_max_values(k, max(i[k] for i in self.processlist))
self.set_max_values(k, max(i[k] for i in self.processlist
if not (i[k] == None)))
def getcount(self):
"""Get the number of processes."""