Skip to content

Commit

Permalink
Work around Py2's lack of "re.ASCII".
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Nov 26, 2020
1 parent c30106f commit 4cb5736
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lxml/html/clean.py
Expand Up @@ -8,8 +8,9 @@

from __future__ import absolute_import

import re
import copy
import re
import sys
try:
from urlparse import urlsplit
from urllib import unquote_plus
Expand Down Expand Up @@ -69,7 +70,8 @@
r'@\s*import', re.I).sub

_looks_like_tag_content = re.compile(
r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=', re.ASCII).search
r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
*((re.ASCII,) if sys.version_info[0] >= 3 else ())).search

# All kinds of schemes besides just javascript: that can cause
# execution:
Expand Down

0 comments on commit 4cb5736

Please sign in to comment.