Skip to content

Commit 4f92357

Browse files
5j9gsnedders
authored andcommitted
Try to import MutableMapping from collections.abc (html5lib#403)
Note that collections.abc has been added in Python 3.3. Fixes html5lib#402
1 parent 0ba6628 commit 4f92357

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy