summaryrefslogtreecommitdiff
path: root/django/utils/html.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-11-24 08:34:02 -0500
committerTim Graham <timograham@gmail.com>2015-01-17 09:00:17 -0500
commitfed25f1105ff0d5fe46cd217b29371ee7f1907f2 (patch)
tree7b5320882f1034a65047948c30d56f38b28a5ba3 /django/utils/html.py
parent4e65f195e1b10d83bb7edc38c908747c4fd537b8 (diff)
Removed compatibility with Python 3.2.
Diffstat (limited to 'django/utils/html.py')
-rw-r--r--django/utils/html.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/django/utils/html.py b/django/utils/html.py
index a596662d22..758d458f40 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -3,7 +3,6 @@
from __future__ import unicode_literals
import re
-import sys
import warnings
from django.utils.deprecation import RemovedInDjango20Warning
@@ -135,12 +134,7 @@ linebreaks = allow_lazy(linebreaks, six.text_type)
class MLStripper(HTMLParser):
def __init__(self):
- # The strict parameter was added in Python 3.2 with a default of True.
- # The default changed to False in Python 3.3 and was deprecated.
- if sys.version_info[:2] == (3, 2):
- HTMLParser.__init__(self, strict=False)
- else:
- HTMLParser.__init__(self)
+ HTMLParser.__init__(self)
self.reset()
self.fed = []
@@ -168,9 +162,7 @@ def _strip_once(value):
return value
try:
s.close()
- except (HTMLParseError, UnboundLocalError):
- # UnboundLocalError because of http://bugs.python.org/issue17802
- # on Python 3.2, triggered by strict=False mode of HTMLParser
+ except HTMLParseError:
return s.get_data() + s.rawdata
else:
return s.get_data()