def _get_proc_username(proc):
    '''
    Returns the username of a Process instance.

    It's backward compatible with < 2.0 versions of psutil.
    '''
    try:
        return proc.username() if PSUTIL2 else proc.username
    except (psutil.NoSuchProcess, psutil.AccessDenied, __HOLE__):
        return None
dataset/ETHPy150Open saltstack/salt/salt/modules/ps.py/_get_proc_username