Skip to content

Commit 9d53c9c

Browse files
committed
Try to import MutableMapping from collections.abc
Note that collections.abc has been added in Python 2.7.
1 parent 950ea0e commit 9d53c9c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: html5lib/_trie/_base.py

+4-1
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 MutableMapping
5+
except ImportError: # Python 2.7
6+
from collections import MutableMapping
47

58

69
class Trie(Mapping):

Diff for: html5lib/treebuilders/dom.py

+4-1
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)