diff --git a/no-import-from-collections.patch b/no-import-from-collections.patch new file mode 100644 index 0000000..3066ff8 --- /dev/null +++ b/no-import-from-collections.patch @@ -0,0 +1,28 @@ +From 242b04de42f4c78ef5c86df55ff41b222986d268 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= +Date: Tue, 3 Dec 2019 16:09:20 +0100 +Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20import=20from=20collections=20g?= + =?UTF-8?q?enerally,=20but=20directly=20from=20collections.abc.?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes #1 +--- + pytrie.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/pytrie.py ++++ b/pytrie.py +@@ -45,7 +45,10 @@ __all__ = ['Trie', 'StringTrie', 'Sorted + + import sys + from copy import copy +-from collections import MutableMapping ++try: ++ from collections.abc import MutableMapping ++except ImportError: ++ from collections import MutableMapping + + import sortedcontainers + diff --git a/python-PyTrie.changes b/python-PyTrie.changes index 46cf7f8..f0c5afe 100644 --- a/python-PyTrie.changes +++ b/python-PyTrie.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Dec 3 15:14:36 UTC 2019 - Matej Cepl + +- Add patch no-import-from-collections.patch to avoid any import + directly from collections. + ------------------------------------------------------------------- Fri Mar 29 08:49:43 UTC 2019 - Jan Engelhardt diff --git a/python-PyTrie.spec b/python-PyTrie.spec index b97eb9b..6408295 100644 --- a/python-PyTrie.spec +++ b/python-PyTrie.spec @@ -1,7 +1,7 @@ # # spec file for package python-PyTrie # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,6 +27,9 @@ URL: https://github.com/gsakkis/pytrie/ Source: https://files.pythonhosted.org/packages/source/P/PyTrie/PyTrie-%{version}.tar.gz Source1: https://raw.githubusercontent.com/gsakkis/pytrie/master/LICENSE Patch0: fix-sorting-py2.patch +# PATCH-FIX-UPSTREAM no-import-from-collections.patch gh#gsakkis/pytrie#5 mcepl@suse.com +# Don't import directly from collections. +Patch1: no-import-from-collections.patch BuildRequires: %{python_module setuptools} BuildRequires: %{python_module sortedcontainers} BuildRequires: fdupes @@ -51,7 +54,7 @@ prefix, and vice versa, finding the items whose keys are prefixes of a given key %prep %setup -q -n PyTrie-%{version} cp %{SOURCE1} . -%patch0 -p1 +%autopatch -p1 %build %python_build