diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-02-18 15:17:57 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-02-18 15:17:57 +0100 |
commit | 10c22490612b1f0bb98be81a0dfc66f4b8030f13 (patch) | |
tree | 6147f148f656bc4d7529b2540e97c6eb1dc8e5f5 | |
parent | 48b71387901859566ba197a65fb2cff01d8b12b1 (diff) | |
parent | dd237b19a4ca286ed7ce9f89b213b2848c9078cf (diff) | |
download | psutil-10c22490612b1f0bb98be81a0dfc66f4b8030f13.tar.gz |
Merge branch 'master' of github.com:giampaolo/psutil
-rw-r--r-- | CREDITS | 4 | ||||
-rw-r--r-- | HISTORY.rst | 1 | ||||
-rw-r--r-- | psutil/__init__.py | 3 | ||||
-rw-r--r-- | psutil/_compat.py | 8 |
4 files changed, 16 insertions, 0 deletions
@@ -736,3 +736,7 @@ I: 1822 N: marxin W: https://github.com/marxin I: 1851 + +N: guille +W: https://github.com/guille +I: 1913 diff --git a/HISTORY.rst b/HISTORY.rst index dc4afbff..0998908a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -20,6 +20,7 @@ XXXX-XX-XX - 1892_: [macOS] psutil.cpu_freq() broken on Apple M1. - 1904_: [Windows] OpenProcess fails with ERROR_SUCCESS due to GetLastError() called after sprintf(). (patch by alxchk) +- 1913_: [Linux] wait_procs seemingly ignoring timeout, TimeoutExpired thrown 5.8.0 ===== diff --git a/psutil/__init__.py b/psutil/__init__.py index 44efb7ff..7dac47d5 100644 --- a/psutil/__init__.py +++ b/psutil/__init__.py @@ -47,6 +47,7 @@ from ._common import ZombieProcess from ._compat import long from ._compat import PermissionError from ._compat import ProcessLookupError +from ._compat import SubprocessTimeoutExpired as _SubprocessTimeoutExpired from ._compat import PY3 as _PY3 from ._common import CONN_CLOSE @@ -1505,6 +1506,8 @@ def wait_procs(procs, timeout=None, callback=None): returncode = proc.wait(timeout=timeout) except TimeoutExpired: pass + except _SubprocessTimeoutExpired: + pass else: if returncode is not None or not proc.is_running(): # Set new Process instance attribute. diff --git a/psutil/_compat.py b/psutil/_compat.py index 17f38485..90938687 100644 --- a/psutil/_compat.py +++ b/psutil/_compat.py @@ -422,3 +422,11 @@ except ImportError: return (res[1], res[0]) except Exception: return fallback + + +# python 3.3 +try: + from subprocess import TimeoutExpired as SubprocessTimeoutExpired +except ImportError: + class SubprocessTimeoutExpired: + pass |