Skip to content

Commit f3c8eb3

Browse files
committed
Merge branch 'master' into wbr
2 parents 2d72f22 + 4f92357 commit f3c8eb3

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

.appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ environment:
66
matrix:
77
- TOXENV: py27-base
88
- TOXENV: py27-optional
9-
- TOXENV: py33-base
10-
- TOXENV: py33-optional
119
- TOXENV: py34-base
1210
- TOXENV: py34-optional
1311
- TOXENV: py35-base

html5lib/_inputstream.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
from __future__ import absolute_import, division, unicode_literals
22

3-
from six import text_type, binary_type
3+
from six import text_type
44
from six.moves import http_client, urllib
55

66
import codecs
77
import re
8+
from io import BytesIO, StringIO
89

910
import webencodings
1011

1112
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
1213
from .constants import _ReparseException
1314
from . import _utils
1415

15-
from io import StringIO
16-
17-
try:
18-
from io import BytesIO
19-
except ImportError:
20-
BytesIO = StringIO
21-
2216
# Non-unicode versions of constants for use in the pre-parser
2317
spaceCharactersBytes = frozenset([item.encode("ascii") for item in spaceCharacters])
2418
asciiLettersBytes = frozenset([item.encode("ascii") for item in asciiLetters])
@@ -908,7 +902,7 @@ def parse(self):
908902
def lookupEncoding(encoding):
909903
"""Return the python codec name corresponding to an encoding or None if the
910904
string doesn't correspond to a valid encoding."""
911-
if isinstance(encoding, binary_type):
905+
if isinstance(encoding, bytes):
912906
try:
913907
encoding = encoding.decode("ascii")
914908
except UnicodeDecodeError:

html5lib/_trie/_base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from __future__ import absolute_import, division, unicode_literals
22

3-
from collections import Mapping
3+
try:
4+
from collections.abc import Mapping
5+
except ImportError: # Python 2.7
6+
from collections import Mapping
47

58

69
class Trie(Mapping):

html5lib/treebuilders/dom.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from __future__ import absolute_import, division, unicode_literals
22

33

4-
from collections import MutableMapping
4+
try:
5+
from collections.abc import MutableMapping
6+
except ImportError: # Python 2.7
7+
from collections import MutableMapping
58
from xml.dom import minidom, Node
69
import weakref
710

0 commit comments

Comments
 (0)