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:
Gerwin Klein 2020-05-12 16:58:46 +08:00
parent 71e7f87614
commit b7525f8d43
1 changed files with 3 additions and 0 deletions

3
misc/regression/memusage.py Normal file → Executable file
View File

@ -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