Skip to content

Commit c5d2527

Browse files
committed
More robust tracking of subprocesses for macOS.
Ignore psutil.AccessDenied when trying to access children - root cause is discussed in Issue 71.
1 parent 371fe94 commit c5d2527

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

memory_profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _get_child_memory(process, meminfo_attr=None):
104104
try:
105105
for child in getattr(process, children_attr)(recursive=True):
106106
yield getattr(child, meminfo_attr)()[0] / _TWO_20
107-
except psutil.NoSuchProcess:
107+
except (psutil.NoSuchProcess, psutil.AccessDenied):
108108
# https://github.com/fabianp/memory_profiler/issues/71
109109
yield 0.0
110110

0 commit comments

Comments
 (0)