grab HTMLParser from six and adapt initialization to py3 (#39533)
This commit is contained in:
parent
37534c6980
commit
5b788a5dff
|
@ -29,11 +29,10 @@ import copy
|
||||||
import mimetypes
|
import mimetypes
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from HTMLParser import HTMLParser
|
|
||||||
|
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
from django.utils.six.moves.html_parser import HTMLParser
|
||||||
|
|
||||||
|
|
||||||
def to_dash_case(camel_str):
|
def to_dash_case(camel_str):
|
||||||
|
@ -52,11 +51,10 @@ def force_encoded_string_output(func, default_enc='utf-8'):
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
|
||||||
class MLStripper(HTMLParser):
|
class MLStripper(HTMLParser, object):
|
||||||
"""HTML parser that removes html tags."""
|
"""HTML parser that removes html tags."""
|
||||||
# pylint: disable=super-init-not-called
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.reset()
|
super(MLStripper, self).__init__()
|
||||||
self.fed = []
|
self.fed = []
|
||||||
|
|
||||||
def handle_data(self, data):
|
def handle_data(self, data):
|
||||||
|
|
Reference in New Issue