diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-11-13 00:27:06 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-11-13 00:27:06 +0100 |
commit | 684c6fb5a425a9667654d0b8a70e790f1b1069e7 (patch) | |
tree | 0db7f1deffbea3d5e58ae125ee7f150a41bbc9a6 /psutil/_psposix.py | |
parent | 3c5438978f621f18b8e9b0b70fde4182221d7cb3 (diff) | |
parent | 4d3f5ba337c5a91efa642699cc96331718889b4f (diff) | |
download | psutil-1173-debug-mode.tar.gz |
Merge branch 'master' into 1173-debug-mode1173-debug-mode
Diffstat (limited to 'psutil/_psposix.py')
-rw-r--r-- | psutil/_psposix.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/psutil/_psposix.py b/psutil/_psposix.py index 66d81a3d..6bb8444d 100644 --- a/psutil/_psposix.py +++ b/psutil/_psposix.py @@ -15,14 +15,10 @@ from ._common import sdiskusage from ._common import usage_percent from ._compat import PY3 from ._compat import unicode +from ._exceptions import TimeoutExpired -__all__ = ['TimeoutExpired', 'pid_exists', 'wait_pid', 'disk_usage', - 'get_terminal_map'] - - -class TimeoutExpired(Exception): - pass +__all__ = ['pid_exists', 'wait_pid', 'disk_usage', 'get_terminal_map'] def pid_exists(pid): @@ -53,7 +49,7 @@ def pid_exists(pid): return True -def wait_pid(pid, timeout=None): +def wait_pid(pid, timeout=None, proc_name=None): """Wait for process with pid 'pid' to terminate and return its exit status code as an integer. @@ -67,7 +63,7 @@ def wait_pid(pid, timeout=None): def check_timeout(delay): if timeout is not None: if timer() >= stop_at: - raise TimeoutExpired() + raise TimeoutExpired(timeout, pid=pid, name=proc_name) time.sleep(delay) return min(delay * 2, 0.04) |