15
0
forked from pool/python-PyTrie

Accepting request 753288 from devel:languages:python

- Add patch no-import-from-collections.patch to avoid any import
  directly from collections.

OBS-URL: https://build.opensuse.org/request/show/753288
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-PyTrie?expand=0&rev=3
This commit is contained in:
2019-12-04 12:53:40 +00:00
committed by Git OBS Bridge
3 changed files with 39 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
From 242b04de42f4c78ef5c86df55ff41b222986d268 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
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

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Dec 3 15:14:36 UTC 2019 - Matej Cepl <mcepl@suse.com>
- Add patch no-import-from-collections.patch to avoid any import
directly from collections.
-------------------------------------------------------------------
Fri Mar 29 08:49:43 UTC 2019 - Jan Engelhardt <jengelh@inai.de>

View File

@@ -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