summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-05-02 15:19:53 -0700
committerGitHub <noreply@github.com>2020-05-03 00:19:53 +0200
commit42368e6a786415d932cb48d0fd006a0c302ab31b (patch)
treebb9ed83939f4742971791fa699282a82844ce66b /README.rst
parent6f2bdc4223789af13156915e930f2fff7d68d46a (diff)
downloadpsutil-42368e6a786415d932cb48d0fd006a0c302ab31b.tar.gz
Process wait() improvements (#1747)
* `Process.wait()` on POSIX now returns an `enum` showing the negative which was used to terminate the process: ```python >>> import psutil >>> p = psutil.Process(9891) >>> p.terminate() >>> p.wait() <Negsignal.SIGTERM: -15> ``` * the return value is cached so that the exit code can be retrieved on then next call, mimicking `subprocess.Popen.wait()` * `Process` object provides more `status` and `exitcode` additional info on `str()` and `repr()`: ``` >>> proc psutil.Process(pid=12739, name='python3', status='terminated', exitcode=<Negsigs.SIGTERM: -15>, started='15:08:20') ``` Extra: * improved `wait()` doc * reverted #1736: `psutil.Popen` uses original `subprocess.Popen.wait` method (safer)
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/README.rst b/README.rst
index 62ab3f23..2137a1a2 100644
--- a/README.rst
+++ b/README.rst
@@ -438,7 +438,7 @@ Process management
>>> p.terminate()
>>> p.kill()
>>> p.wait(timeout=3)
- 0
+ <Exitcode.EX_OK: 0>
>>>
>>> psutil.test()
USER PID %CPU %MEM VSZ RSS TTY START TIME COMMAND