Example #1
0
def _escape_cdata(text):
    # escape character data
    try:
        if any(
                chr(c) in text for c in
            [c for c in range(0, 32) if c not in (
                ord("\n"),
                ord("\t"),
            )]):
            return "<![CDATA[" + escape_cdata_control_chars(text) + "]]>"
    except (TypeError, AttributeError):
        ET._raise_serialization_error(text)
    return ET._original_escape_cdata(text)