From 19af531418d51e471553bde5349a632296a60042c50eabe634fdc5996b43c0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 6 May 2020 07:46:57 +0000 Subject: [PATCH] - Add patch to not collide with collections deprecation: * collections-abc.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html5lib?expand=0&rev=43 --- collections-abc.patch | 44 +++++++++++++++++++++++++++++++++++++++++ python-html5lib.changes | 6 ++++++ python-html5lib.spec | 1 + 3 files changed, 51 insertions(+) create mode 100644 collections-abc.patch diff --git a/collections-abc.patch b/collections-abc.patch new file mode 100644 index 0000000..f0d0bad --- /dev/null +++ b/collections-abc.patch @@ -0,0 +1,44 @@ +From 322a2d57bfdc52a9ce14bee93f9abb372cc08487 Mon Sep 17 00:00:00 2001 +From: 5j9 <5j9@users.noreply.github.com> +Date: Sun, 23 Sep 2018 11:32:46 +0330 +Subject: [PATCH] Try to import MutableMapping from collections.abc + +Note that collections.abc has been added in Python 3.3. + +Fixes #402 +--- + html5lib/_trie/_base.py | 5 ++++- + html5lib/treebuilders/dom.py | 5 ++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/html5lib/_trie/_base.py b/html5lib/_trie/_base.py +index a1158bbb..6b71975f 100644 +--- a/html5lib/_trie/_base.py ++++ b/html5lib/_trie/_base.py +@@ -1,6 +1,9 @@ + from __future__ import absolute_import, division, unicode_literals + +-from collections import Mapping ++try: ++ from collections.abc import Mapping ++except ImportError: # Python 2.7 ++ from collections import Mapping + + + class Trie(Mapping): +diff --git a/html5lib/treebuilders/dom.py b/html5lib/treebuilders/dom.py +index dcfac220..d8b53004 100644 +--- a/html5lib/treebuilders/dom.py ++++ b/html5lib/treebuilders/dom.py +@@ -1,7 +1,10 @@ + from __future__ import absolute_import, division, unicode_literals + + +-from collections import MutableMapping ++try: ++ from collections.abc import MutableMapping ++except ImportError: # Python 2.7 ++ from collections import MutableMapping + from xml.dom import minidom, Node + import weakref + diff --git a/python-html5lib.changes b/python-html5lib.changes index 703a832..238d1b8 100644 --- a/python-html5lib.changes +++ b/python-html5lib.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 6 07:41:38 UTC 2020 - Tomáš Chvátal + +- Add patch to not collide with collections deprecation: + * collections-abc.patch + ------------------------------------------------------------------- Wed Jan 15 12:31:39 UTC 2020 - Tomáš Chvátal diff --git a/python-html5lib.spec b/python-html5lib.spec index 6adb6b3..9f3e7ce 100644 --- a/python-html5lib.spec +++ b/python-html5lib.spec @@ -27,6 +27,7 @@ Source: https://files.pythonhosted.org/packages/source/h/html5lib/html5l # PATCH-FIX-UPSTREAM pytest4-mhroncok.patch gh#html5lib/html5lib-python#429 mcepl@suse.com # This patch makes testsuite pass with pytest4 Patch0: pytest4-mhroncok.patch +Patch1: collections-abc.patch BuildRequires: %{python_module Genshi} BuildRequires: %{python_module datrie} BuildRequires: %{python_module lxml}