From d97d5854367f5a269d08cf3144ac0440fa5bd92d Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: May 22 2018 11:28:46 +0000 Subject: Backport upstream fix for Python 3.7 --- diff --git a/python-more-itertools.spec b/python-more-itertools.spec index 470f882..e6753b6 100644 --- a/python-more-itertools.spec +++ b/python-more-itertools.spec @@ -10,7 +10,7 @@ See https://pythonhosted.org/more-itertools/index.html for documentation.\ Name: python-%{srcname} Version: 4.1.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: %{sum} License: MIT URL: https://github.com/erikrose/more-itertools @@ -23,6 +23,9 @@ BuildRequires: python3-devel BuildRequires: python3-nose BuildRequires: python3-six +# https://github.com/erikrose/more-itertools/commit/e38574428c952b143fc4e0e42cb99b242c7b7977 +Patch0: python37.patch + %description %_description %package -n python2-%{srcname} @@ -38,7 +41,7 @@ Summary: %{sum} %description -n python3-%{srcname} %_description %prep -%autosetup -n %{srcname}-%{version} +%autosetup -n %{srcname}-%{version} -p1 %build %py2_build @@ -67,6 +70,9 @@ Summary: %{sum} %{python3_sitelib}/more_itertools-%{version}-py%{python3_version}.egg-info %changelog +* Tue May 22 2018 Miro Hrončok - 4.1.0-2 +- Backport upstream fix for Python 3.7 + * Sat Mar 24 2018 Thomas Moschny - 4.1.0-1 - Update to 4.1.0. - Do not package tests. diff --git a/python37.patch b/python37.patch new file mode 100644 index 0000000..f46ee73 --- /dev/null +++ b/python37.patch @@ -0,0 +1,40 @@ +From e38574428c952b143fc4e0e42cb99b242c7b7977 Mon Sep 17 00:00:00 2001 +From: Irmen de Jong +Date: Tue, 3 Apr 2018 19:43:08 +0200 +Subject: [PATCH] fix bucket iteration; adhere to Pep 479. Required for Python + 3.7 which is now also included in the test matrix + +--- + more_itertools/more.py | 5 ++++- + setup.py | 2 ++ + 4 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/more_itertools/more.py b/more_itertools/more.py +index c4b08ae..ca413a7 100644 +--- a/more_itertools/more.py ++++ b/more_itertools/more.py +@@ -723,7 +723,10 @@ def _get_values(self, value): + # a matching item, caching the rest. + else: + while True: +- item = next(self._it) ++ try: ++ item = next(self._it) ++ except StopIteration: ++ return + item_value = self._key(item) + if item_value == value: + yield item +diff --git a/setup.py b/setup.py +index c4670dd..e6fd01b 100644 +--- a/setup.py ++++ b/setup.py +@@ -51,6 +51,8 @@ def get_long_description(): + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', ++ 'Programming Language :: Python :: 3.6', ++ 'Programming Language :: Python :: 3.7', + 'Topic :: Software Development :: Libraries'], + keywords=['itertools', 'iterator', 'iteration', 'filter', 'peek', + 'peekable', 'collate', 'chunk', 'chunked'],