Commit 44d17917 authored by Jannis Leidel's avatar Jannis Leidel
Browse files

Fixed #17641 -- Work around an issue in Python distributions that remove the ...

Fixed #17641 -- Work around an issue in Python distributions that remove the  module attribute ('2.7.2+'). Many thanks to Ramiro Morales for finding it.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17456 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 0f6cf4ab
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
import HTMLParser as _HTMLParser
import re


class HTMLParser(_HTMLParser.HTMLParser):
@@ -11,7 +12,10 @@ class HTMLParser(_HTMLParser.HTMLParser):
        self.cdata_tag = None

    def set_cdata_mode(self, tag):
        try:
            self.interesting = _HTMLParser.interesting_cdata
        except AttributeError:
            self.interesting = re.compile(r'</\s*%s\s*>' % tag.lower(), re.I)
        self.cdata_tag = tag.lower()

    def clear_cdata_mode(self):