diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-02-04 08:29:32 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-02-04 08:29:32 +0100 |
commit | c462b81db32a130f9bb5faf27014882c7fa77725 (patch) | |
tree | 10fc14fe772c68965b0ab261cc61f9184a09a5bb | |
parent | 576633249bbb2c79b7ea125019d311ce19440386 (diff) | |
download | psutil-c462b81db32a130f9bb5faf27014882c7fa77725.tar.gz |
remove 'support for private module import' hack
-rw-r--r-- | psutil/_psbsd.py | 10 | ||||
-rw-r--r-- | psutil/_pslinux.py | 6 | ||||
-rw-r--r-- | psutil/_psosx.py | 7 | ||||
-rw-r--r-- | psutil/_pssunos.py | 7 | ||||
-rw-r--r-- | psutil/_pswindows.py | 6 |
5 files changed, 0 insertions, 36 deletions
diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py index 4fed0195..5397026f 100644 --- a/psutil/_psbsd.py +++ b/psutil/_psbsd.py @@ -315,10 +315,6 @@ def wrap_exceptions(fun): try: return fun(self, *args, **kwargs) except OSError as err: - # support for private module import - if (NoSuchProcess is None or AccessDenied is None or - ZombieProcess is None): - raise if err.errno == errno.ESRCH: if not pid_exists(self.pid): raise NoSuchProcess(self.pid, self._name) @@ -335,9 +331,6 @@ def wrap_exceptions_procfs(inst): try: yield except EnvironmentError as err: - # support for private module import - if NoSuchProcess is None or AccessDenied is None: - raise # ENOENT (no such file or directory) gets raised on open(). # ESRCH (no such process) can get raised on read() if # process is gone in meantime. @@ -526,9 +519,6 @@ class Process(object): try: return _psposix.wait_pid(self.pid, timeout) except _psposix.TimeoutExpired: - # support for private module import - if TimeoutExpired is None: - raise raise TimeoutExpired(timeout, self.pid, self._name) @wrap_exceptions diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index bda98539..bd6c3428 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -815,9 +815,6 @@ def wrap_exceptions(fun): try: return fun(self, *args, **kwargs) except EnvironmentError as err: - # support for private module import - if NoSuchProcess is None or AccessDenied is None: - raise # ENOENT (no such file or directory) gets raised on open(). # ESRCH (no such process) can get raised on read() if # process is gone in meantime. @@ -934,9 +931,6 @@ class Process(object): try: return _psposix.wait_pid(self.pid, timeout) except _psposix.TimeoutExpired: - # support for private module import - if TimeoutExpired is None: - raise raise TimeoutExpired(timeout, self.pid, self._name) @wrap_exceptions diff --git a/psutil/_psosx.py b/psutil/_psosx.py index 52994847..3c8abc60 100644 --- a/psutil/_psosx.py +++ b/psutil/_psosx.py @@ -199,10 +199,6 @@ def wrap_exceptions(fun): try: return fun(self, *args, **kwargs) except OSError as err: - # support for private module import - if (NoSuchProcess is None or AccessDenied is None or - ZombieProcess is None): - raise if err.errno == errno.ESRCH: if not pid_exists(self.pid): raise NoSuchProcess(self.pid, self._name) @@ -339,9 +335,6 @@ class Process(object): try: return _psposix.wait_pid(self.pid, timeout) except _psposix.TimeoutExpired: - # support for private module import - if TimeoutExpired is None: - raise raise TimeoutExpired(timeout, self.pid, self._name) @wrap_exceptions diff --git a/psutil/_pssunos.py b/psutil/_pssunos.py index b6af457e..74040d9a 100644 --- a/psutil/_pssunos.py +++ b/psutil/_pssunos.py @@ -260,10 +260,6 @@ def wrap_exceptions(fun): try: return fun(self, *args, **kwargs) except EnvironmentError as err: - # support for private module import - if (NoSuchProcess is None or AccessDenied is None or - ZombieProcess is None): - raise # ENOENT (no such file or directory) gets raised on open(). # ESRCH (no such process) can get raised on read() if # process is gone in meantime. @@ -572,7 +568,4 @@ class Process(object): try: return _psposix.wait_pid(self.pid, timeout) except _psposix.TimeoutExpired: - # support for private module import - if TimeoutExpired is None: - raise raise TimeoutExpired(timeout, self.pid, self._name) diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py index 4403e5eb..63805524 100644 --- a/psutil/_pswindows.py +++ b/psutil/_pswindows.py @@ -282,9 +282,6 @@ def wrap_exceptions(fun): try: return fun(self, *args, **kwargs) except OSError as err: - # support for private module import - if NoSuchProcess is None or AccessDenied is None: - raise if err.errno in ACCESS_DENIED_SET: raise AccessDenied(self.pid, self._name) if err.errno == errno.ESRCH: @@ -418,9 +415,6 @@ class Process(object): timeout = int(timeout * 1000) ret = cext.proc_wait(self.pid, timeout) if ret == WAIT_TIMEOUT: - # support for private module import - if TimeoutExpired is None: - raise RuntimeError("timeout expired") raise TimeoutExpired(timeout, self.pid, self._name) return ret |