Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17641 -- Work around an issue in Python distributions that rem…

…ove 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
  • Loading branch information...
commit 44d1791779ecf86ab5de92bce5236f9401efce0e 1 parent 0f6cf4a
Jannis Leidel authored February 05, 2012

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  django/utils/htmlparser.py
6  django/utils/htmlparser.py
... ...
@@ -1,4 +1,5 @@
1 1
 import HTMLParser as _HTMLParser
  2
+import re
2 3
 
3 4
 
4 5
 class HTMLParser(_HTMLParser.HTMLParser):
@@ -11,7 +12,10 @@ def __init__(self):
11 12
         self.cdata_tag = None
12 13
 
13 14
     def set_cdata_mode(self, tag):
14  
-        self.interesting = _HTMLParser.interesting_cdata
  15
+        try:
  16
+            self.interesting = _HTMLParser.interesting_cdata
  17
+        except AttributeError:
  18
+            self.interesting = re.compile(r'</\s*%s\s*>' % tag.lower(), re.I)
15 19
         self.cdata_tag = tag.lower()
16 20
 
17 21
     def clear_cdata_mode(self):

0 notes on commit 44d1791

Please sign in to comment.
Something went wrong with that request. Please try again.