From fb864a9e4ea393c3bd863de3f1c62275ce94f622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 9 Sep 2024 10:18:02 +0200 Subject: [PATCH] manually remove fallback imports --- html5lib/_trie/_base.py | 5 +---- html5lib/_utils.py | 5 +---- html5lib/treebuilders/dom.py | 5 +---- html5lib/treebuilders/etree_lxml.py | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/html5lib/_trie/_base.py b/html5lib/_trie/_base.py index fe2d02e5..63927ee4 100644 --- a/html5lib/_trie/_base.py +++ b/html5lib/_trie/_base.py @@ -1,8 +1,5 @@ -try: - from collections.abc import Mapping -except ImportError: # Python 2.7 - from collections.abc import Mapping +from collections.abc import Mapping class Trie(Mapping): diff --git a/html5lib/_utils.py b/html5lib/_utils.py index 1c229d0f..2e74c07f 100644 --- a/html5lib/_utils.py +++ b/html5lib/_utils.py @@ -1,10 +1,7 @@ from types import ModuleType -try: - from collections.abc import Mapping -except ImportError: - from collections.abc import Mapping +from collections.abc import Mapping from six import text_type, PY3 diff --git a/html5lib/treebuilders/dom.py b/html5lib/treebuilders/dom.py index 09b217c4..bc56c708 100644 --- a/html5lib/treebuilders/dom.py +++ b/html5lib/treebuilders/dom.py @@ -1,9 +1,6 @@ -try: - from collections.abc import MutableMapping -except ImportError: # Python 2.7 - from collections.abc import MutableMapping +from collections.abc import MutableMapping from xml.dom import minidom, Node import weakref diff --git a/html5lib/treebuilders/etree_lxml.py b/html5lib/treebuilders/etree_lxml.py index bc2d779e..3e88d76e 100644 --- a/html5lib/treebuilders/etree_lxml.py +++ b/html5lib/treebuilders/etree_lxml.py @@ -15,10 +15,7 @@ import re import sys -try: - from collections.abc import MutableMapping -except ImportError: - from collections.abc import MutableMapping +from collections.abc import MutableMapping from . import base from ..constants import DataLossWarning