diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-03 20:55:31 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-03 20:55:31 +0200 |
commit | 98915102cc97869b8418d38088a1dcb59b931ffe (patch) | |
tree | 668bbee7ef9261ac2e6bfd0407733ca9f3585e4c /docs | |
parent | 5d39cc9c8d8dc04862786abba0307ed9350144ce (diff) | |
download | psutil-98915102cc97869b8418d38088a1dcb59b931ffe.tar.gz |
update doc re. to exception classes
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/docs/index.rst b/docs/index.rst index 11ea8780..51ec3cc7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -985,31 +985,37 @@ Exceptions .. class:: NoSuchProcess(pid, name=None, msg=None) Raised by :class:`Process` class methods when no process with the given - *pid* is found in the current process list or when a process no longer + *pid* is found in the current process list, or when a process no longer exists. *name* is the name the process had before disappearing and gets set only if :meth:`Process.name()` was previously called. .. class:: ZombieProcess(pid, name=None, ppid=None, msg=None) This may be raised by :class:`Process` class methods when querying a zombie - process on UNIX (Windows doesn't have zombie processes). Depending on the - method called the OS may be able to succeed in retrieving the process - information or not. - Note: this is a subclass of :class:`NoSuchProcess` so if you're not - interested in retrieving zombies (e.g. when using :func:`process_iter()`) - you can ignore this exception and just catch :class:`NoSuchProcess`. + process on UNIX (Windows doesn't have zombie processes). + *name* and *ppid* attributes are available if :meth:`Process.name()` or + :meth:`Process.ppid()` methods were called before the process turned into a + zombie. + + .. note:: + + this is a subclass of :class:`NoSuchProcess` so if you're not interested + in retrieving zombies (e.g. when using :func:`process_iter()`) you can + ignore this exception and just catch :class:`NoSuchProcess`. .. versionadded:: 3.0.0 .. class:: AccessDenied(pid=None, name=None, msg=None) Raised by :class:`Process` class methods when permission to perform an - action is denied. "name" is the name of the process (may be ``None``). + action is denied due to insufficient privileges. + *name* attribute is available if :meth:`Process.name()` was previously called. .. class:: TimeoutExpired(seconds, pid=None, name=None, msg=None) - Raised by :meth:`Process.wait` if timeout expires and process is still - alive. + Raised by :meth:`Process.wait` method if timeout expires and the process is + still alive. + *name* attribute is available if :meth:`Process.name()` was previously called. Process class ------------- |