Dealing with basesting (one baby step closer to Py3 salvation)

This commit is contained in:
Miroslav Stampar
2019-03-28 13:53:54 +01:00
parent 915bc1fc99
commit afe497a954
25 changed files with 112 additions and 98 deletions

View File

@@ -17,6 +17,7 @@ import sys
from lib.core.settings import IS_WIN
from lib.core.settings import UNICODE_ENCODING
from thirdparty import six
def base64decode(value):
"""
@@ -145,7 +146,7 @@ def htmlunescape(value):
"""
retVal = value
if value and isinstance(value, basestring):
if value and isinstance(value, six.string_types):
codes = (("&lt;", '<'), ("&gt;", '>'), ("&quot;", '"'), ("&nbsp;", ' '), ("&amp;", '&'), ("&apos;", "'"))
retVal = reduce(lambda x, y: x.replace(y[0], y[1]), codes, retVal)
try: