Merge pull request #1236 from spike008t/fix/develop-python3-macos

fix on macOS when value is NoneType when compute the max values
This commit is contained in:
Nicolas Hennion 2018-02-15 08:17:47 +01:00 committed by GitHub
commit 2cdc9b0b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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."""