def _get_proc_username(proc):
 try:
  return (proc.username() if PSUTIL2 else proc.username)
 except (psutil.NoSuchProcess, psutil.AccessDenied, KeyError):
  return None

def _get_proc_username ( proc ) : try : return ( proc . username ( ) if PSUTIL2 else proc . username ) except ( psutil . NoSuchProcess , psutil . AccessDenied , KeyError ) : return None
returns the username of a process instance .