parameters: (fun)
return_statement: return wrapper
docstring: Call callable into a try/except clause and translate ENOENT,
      EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
docstring_summary: Call callable into a try/except clause and translate ENOENT,
      EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
docstring_tokens: Call callable into a try / except clause and translate ENOENT EACCES and EPERM in NoSuchProcess or AccessDenied exceptions .
function: def wrap_exceptions(fun):
      """Call callable into a try/except clause and translate ENOENT,
      EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
      """
      def wrapper(self, *args, **kwargs):
          try:
              return fun(self, *args, **kwargs)
          except EnvironmentError:
              # 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.
              err = sys.exc_info()[1]
              if err.errno in (errno.ENOENT, errno.ESRCH):
                  raise NoSuchProcess(self.pid, self._name)
              if err.errno in (errno.EPERM, errno.EACCES):
                  raise AccessDenied(self.pid, self._name)
              raise
      return wrapper
function_tokens: def wrap_exceptions ( fun ) : def wrapper ( self , * args , * * kwargs ) : try : return fun ( self , * args , * * kwargs ) except EnvironmentError : # 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. err = sys . exc_info ( ) [ 1 ] if err . errno in ( errno . ENOENT , errno . ESRCH ) : raise NoSuchProcess ( self . pid , self . _name ) if err . errno in ( errno . EPERM , errno . EACCES ) : raise AccessDenied ( self . pid , self . _name ) raise return wrapper