summaryrefslogtreecommitdiff
path: root/django/utils
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
parent4e65f195e1b10d83bb7edc38c908747c4fd537b8 (diff)
Removed compatibility with Python 3.2.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/html.py12
-rw-r--r--django/utils/html_parser.py5
2 files changed, 3 insertions, 14 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()
diff --git a/django/utils/html_parser.py b/django/utils/html_parser.py
index ab1f654978..4aff4a9a78 100644
--- a/django/utils/html_parser.py
+++ b/django/utils/html_parser.py
@@ -4,10 +4,7 @@ import sys
current_version = sys.version_info
-use_workaround = (
- (current_version < (2, 7, 3)) or
- (current_version >= (3, 0) and current_version < (3, 2, 3))
-)
+use_workaround = current_version < (2, 7, 3)
try:
HTMLParseError = _html_parser.HTMLParseError