html_diff: Migrate from `Text` to `str`.

This commit is contained in:
Harshit Bansal 2017-10-30 20:24:22 +00:00 committed by Tim Abbott
parent c863bb83a0
commit d140451fb4
1 changed files with 3 additions and 3 deletions

View File

@ -1,14 +1,14 @@
import lxml
from lxml.html.diff import htmldiff
from typing import Optional, Text
from typing import Optional
def highlight_with_class(text, klass):
# type: (Text, Text) -> Text
# type: (str, str) -> str
return '<span class="%s">%s</span>' % (klass, text)
def highlight_html_differences(s1, s2, msg_id=None):
# type: (Text, Text, Optional[int]) -> Text
# type: (str, str, Optional[int]) -> str
retval = htmldiff(s1, s2)
fragment = lxml.html.fromstring(retval) # type: ignore # https://github.com/python/typeshed/issues/525