diff --git a/MetaTube.bundle/Contents/Code/utils.py b/MetaTube.bundle/Contents/Code/utils.py index e15ee56..9e1127c 100644 --- a/MetaTube.bundle/Contents/Code/utils.py +++ b/MetaTube.bundle/Contents/Code/utils.py @@ -15,6 +15,8 @@ # Python 3 compatible code if sys.version_info.major == 3: unicode = str + # noinspection PyShadowingBuiltins + filter = lambda f, t: u''.join(i for i in t if f(i)) # Based on an answer by John Machin on Stack Overflow: @@ -27,7 +29,7 @@ def is_valid_xml_char(i): 0x10000 <= c <= 0x10FFFF or c in (0x9, 0xA, 0xD)) - return u''.join(c for c in s if is_valid_xml_char(c)) + return filter(is_valid_xml_char, s) def safe_unicode(o):