misc: make memusage.py not crash on MacOS for newer psutil versions
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
This commit is contained in:
parent
71e7f87614
commit
b7525f8d43
|
@ -45,6 +45,9 @@ else:
|
|||
# If we don't have permission to read a particular process,
|
||||
# just return 0.
|
||||
return 0
|
||||
except AttributeError:
|
||||
# Newer versions of psutil do not support memory_maps on MacOS
|
||||
return 0
|
||||
|
||||
def get_total_usage(pid):
|
||||
'''Retrieve the memory usage of a process by PID including its children. We
|
||||
|
|
Loading…
Reference in New Issue