rebuild for 10.11+

This commit is contained in:
j 2019-01-10 14:33:55 +05:30
commit 901b731582
234 changed files with 1522 additions and 927 deletions

View file

@ -46,7 +46,6 @@ import re
from functools import partial
try:
# while unnecessary, importing from 'collections.abc' is the right way to do it
from collections.abc import MutableMapping, MutableSet
except ImportError:
from collections import MutableMapping, MutableSet

View file

@ -1,4 +1,8 @@
from collections import MutableSet
try:
from collections.abc import MutableSet
except ImportError:
from collections import MutableSet
class SetMixin(MutableSet):

Binary file not shown.

View file

@ -1,9 +1,13 @@
# cython: language_level=2
"""A cleanup tool for HTML.
Removes unwanted tags and content. See the `Cleaner` class for
details.
"""
from __future__ import absolute_import
import re
import copy
try:
@ -27,11 +31,6 @@ try:
except NameError:
# Python 3
unicode = str
try:
bytes
except NameError:
# Python < 2.6
bytes = str
try:
basestring
except NameError:
@ -213,7 +212,7 @@ class Cleaner(object):
safe_attrs = defs.safe_attrs
add_nofollow = False
host_whitelist = ()
whitelist_tags = set(['iframe', 'embed'])
whitelist_tags = {'iframe', 'embed'}
def __init__(self, **kw):
for name, value in kw.items():

Binary file not shown.

View file

@ -1,3 +1,7 @@
# cython: language_level=3
from __future__ import absolute_import
import difflib
from lxml import etree
from lxml.html import fragment_fromstring
@ -621,7 +625,7 @@ def fixup_chunks(chunks):
% (cur_word, result, chunk, chunks))
cur_word.post_tags.append(chunk)
else:
assert(0)
assert False
if not result:
return [token('', pre_tags=tag_accum)]
@ -799,7 +803,6 @@ def _move_el_inside_block(el, tag):
if _contains_block_level_tag(child):
break
else:
import sys
# No block-level tags in any child
children_tag = etree.Element(tag)
children_tag.text = el.text