grab HTMLParser from six and adapt initialization to py3 (#39533)

This commit is contained in:
Emmanuel Cazenave 2020-02-04 17:21:41 +01:00
parent 37534c6980
commit 5b788a5dff
1 changed files with 3 additions and 5 deletions

View File

@ -29,11 +29,10 @@ import copy
import mimetypes
import sys
from HTMLParser import HTMLParser
from django.urls import reverse_lazy
from django.utils import six
from django.utils.encoding import force_text
from django.utils.six.moves.html_parser import HTMLParser
def to_dash_case(camel_str):
@ -52,11 +51,10 @@ def force_encoded_string_output(func, default_enc='utf-8'):
return func
class MLStripper(HTMLParser):
class MLStripper(HTMLParser, object):
"""HTML parser that removes html tags."""
# pylint: disable=super-init-not-called
def __init__(self):
self.reset()
super(MLStripper, self).__init__()
self.fed = []
def handle_data(self, data):