Skip to content

Commit

Permalink
Merge branch 'master' of github.com:giampaolo/psutil
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Feb 18, 2021
2 parents 48b7138 + dd237b1 commit 10c2249
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -736,3 +736,7 @@ I: 1822
N: marxin
W: https://github.com/marxin
I: 1851

N: guille
W: https://github.com/guille
I: 1913
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=====
Expand Down
3 changes: 3 additions & 0 deletions psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
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
Expand Down Expand Up @@ -1505,6 +1506,8 @@ def check_gone(proc, timeout):
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.
Expand Down
8 changes: 8 additions & 0 deletions psutil/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,11 @@ def get_terminal_size(fallback=(80, 24)):
return (res[1], res[0])
except Exception:
return fallback


# python 3.3
try:
from subprocess import TimeoutExpired as SubprocessTimeoutExpired
except ImportError:
class SubprocessTimeoutExpired:
pass

0 comments on commit 10c2249

Please sign in to comment.