def wrap_exceptions(callable):
def wrapper(self, *args, **kwargs):<EOL><INDENT>try:<EOL><INDENT>return callable(self, *args, **kwargs)<EOL><DEDENT>except OSError:<EOL><INDENT>err = sys.exc_info()[<NUM_LIT:1>]<EOL>if err.errno in ACCESS_DENIED_SET:<EOL><INDENT>raise AccessDenied(self.pid, self._process_name)<EOL><DEDENT>if err.errno == errno.ESRCH:<EOL><INDENT>raise NoSuchProcess(self.pid, self._process_name)<EOL><DEDENT>raise<EOL><DEDENT><DEDENT>return wrapper<EOL>
Call callable into a try/except clause so that if a
    WindowsError 5 AccessDenied exception is raised we translate it
    into psutil.AccessDenied