!14 fix for python 3.7 deprecation warning about importing certain types from collections vs collections.abc

From: @zhang-liang-pengkun 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-11-16 10:54:59 +00:00 committed by Gitee
commit 66d9da2364
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 30a861bc5a4f53a9ba73923c9048a3632a0f9d18 Mon Sep 17 00:00:00 2001
From: Irmen de Jong <irmen@razorvine.net>
Date: Tue, 3 Apr 2018 18:15:39 +0200
Subject: [PATCH] fix for python 3.7 deprecation warning about importing
certain types from collections vs collections.abc
---
more_itertools/more.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/more_itertools/more.py b/more_itertools/more.py
index c4b08ae..4dc9f15 100644
--- a/more_itertools/more.py
+++ b/more_itertools/more.py
@@ -1,6 +1,6 @@
from __future__ import print_function
-from collections import Counter, defaultdict, deque, Sequence
+from collections import Counter, defaultdict, deque
from functools import partial, wraps
from heapq import merge
from itertools import (
@@ -17,6 +17,10 @@ from itertools import (
)
from operator import itemgetter, lt, gt, sub
from sys import maxsize, version_info
+if version_info < (3, 3):
+ from collections import Sequence
+else:
+ from collections.abc import Sequence
from six import binary_type, string_types, text_type
from six.moves import filter, map, range, zip, zip_longest
--
2.39.0.windows.2

View File

@ -1,12 +1,13 @@
Name: python-more-itertools
Version: 4.1.0
Release: 5
Release: 6
Summary: An opensource python library wrapping around itertools
License: MIT
URL: https://github.com/erikrose/more-itertools
Source0: https://pypi.io/packages/source/m/more-itertools/more-itertools-%{version}.tar.gz
BuildArch: noarch
Patch0000: python37.patch
Patch0001: 0001-fix-for-python-3.7-deprecation-warning-about-importi.patch
%description
This is a python library for efficient use of itertools utility, which also \
@ -61,5 +62,8 @@ See https://pythonhosted.org/more-itertools/index.html for more information.
%{python3_sitelib}/more_itertools-%{version}-py%{python3_version}.egg-info
%changelog
* Thu Nov 16 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 4.1.0-6
- fix for python 3.7 deprecation warning about importing certain types from collections vs collections.abc
* Fri Nov 15 2019 sunguoshuai <sunguoshuai@huawei.com> - 4.1.0-5
- Package init