def _get_proc_cmdline(proc):
    '''
    Returns the cmdline of a Process instance.

    It's backward compatible with < 2.0 versions of psutil.
    '''
    try:
        return salt.utils.data.decode(proc.cmdline() if PSUTIL2 else proc.cmdline)
    except (psutil.NoSuchProcess, psutil.AccessDenied):
        return []