def checkEscChars(l_info,ip):
    """Check for escape character and return either a handler to handle it,
    or None if there is no escape char."""
    if l_info.line[-1] == ip.ESC_HELP \
           and l_info.preChar != ip.ESC_SHELL \
           and l_info.preChar != ip.ESC_SH_CAP:
        # the ? can be at the end, but *not* for either kind of shell escape,
        # because a ? can be a vaild final char in a shell cmd
        return ip.handle_help
    elif l_info.preChar in ip.esc_handlers:
        return ip.esc_handlers[l_info.preChar]
    else:
        return None