diff options
-rw-r--r-- | docs/index.rst | 3 | ||||
-rw-r--r-- | psutil/__init__.py | 1 | ||||
-rw-r--r-- | psutil/_pslinux.py | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/docs/index.rst b/docs/index.rst index 0119b423..ea2384bb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1716,7 +1716,8 @@ Process class .. method:: children(recursive=False) - Return the children of this process as a list of :Class:`Process` objects. + Return the children of this process as a list of :class:`Process` + instances. If recursive is `True` return all the parent descendants. Pseudo code example assuming *A == this process*: :: diff --git a/psutil/__init__.py b/psutil/__init__.py index 98e60870..a8447973 100644 --- a/psutil/__init__.py +++ b/psutil/__init__.py @@ -268,6 +268,7 @@ else: proc = _psplatform.Process(pid) ppid = proc.ppid() except (NoSuchProcess, AccessDenied): + # Note: AccessDenied is unlikely to happen. pass else: ret[pid] = ppid diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index ecf116f3..b57adb34 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1367,6 +1367,8 @@ def ppid_map(): with open_binary("%s/%s/stat" % (procfs_path, pid)) as f: data = f.read() except EnvironmentError as err: + # Note: we should be able to access /stat for all processes + # so we won't bump into EPERM, which is good. if err.errno not in (errno.ENOENT, errno.ESRCH, errno.EPERM, errno.EACCES): raise |