From bdfd71e2fdd4c52be99835909755cc4c8f2bfcd5 Mon Sep 17 00:00:00 2001 From: Jay Loden Date: Fri, 13 Mar 2009 03:22:55 +0000 Subject: Removed need for import of psutil module in platform specific modules by: 1) split exceptions out into error.py so they can be imported by multiple modules within the package and overriden in the global psutil namespace by platform-specific C module versions as needed. 2) Impl.get_process_info() now returns just the tuple, and deproxy() handles passing it to the constructor of a ProcessInfo() object and creating the instance for Process._procinfo I've updated all the files for all platforms but only tested on OS X, will verify nothing broke on Linux, BSD, and Windows and commit any necessary changes in the next revision(s). --- psutil/error.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 psutil/error.py (limited to 'psutil/error.py') diff --git a/psutil/error.py b/psutil/error.py new file mode 100644 index 00000000..d52362e1 --- /dev/null +++ b/psutil/error.py @@ -0,0 +1,9 @@ +import sys + +# this exception get overriden by the platform specific modules if necessary +class NoSuchProcess(Exception): + """No process was found for the given parameters.""" + +class AccessDenied(Exception): + """Exception raised when permission to perform an action is denied.""" + -- cgit v1.2.1