diff --git a/0001-PEP-479-return-instead-of-raise-StopIteration.patch b/0001-PEP-479-return-instead-of-raise-StopIteration.patch new file mode 100644 index 0000000..2aa13c9 --- /dev/null +++ b/0001-PEP-479-return-instead-of-raise-StopIteration.patch @@ -0,0 +1,26 @@ +From 2599f0e57c0a20bd3f8870dbc2c5479cad502597 Mon Sep 17 00:00:00 2001 +From: Sergey Kozlov +Date: Mon, 11 Dec 2017 17:04:20 +0100 +Subject: [PATCH] PEP 479: 'return' instead of 'raise StopIteration'. + +Fro details please visit https://www.python.org/dev/peps/pep-0479/ +--- + netaddr/ip/__init__.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/netaddr/ip/__init__.py b/netaddr/ip/__init__.py +index 489badf..ecf72d0 100644 +--- a/netaddr/ip/__init__.py ++++ b/netaddr/ip/__init__.py +@@ -1258,7 +1258,7 @@ class IPNetwork(BaseIP, IPListMixin): + + if not self.prefixlen <= prefixlen: + # Don't return anything. +- raise StopIteration ++ return + + # Calculate number of subnets to be returned. + width = self._module.width +-- +2.17.1 + diff --git a/python-netaddr.spec b/python-netaddr.spec index 812c527..5244236 100644 --- a/python-netaddr.spec +++ b/python-netaddr.spec @@ -19,6 +19,8 @@ BuildRequires: python2-pytest Patch0: 0001-fixed-broken-tests-in-issue-149-python-3-regression-.patch Patch1: 0001-Do-not-override-executable-path.patch +# From https://github.com/drkjam/netaddr/pull/167 +Patch2: 0001-PEP-479-return-instead-of-raise-StopIteration.patch %global desc A network address manipulation library for Python\ \ @@ -69,6 +71,7 @@ BuildRequires: python3-pytest %setup -q -n netaddr-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 # Make rpmlint happy, get rid of DOS line endings sed -i 's/\r//' netaddr/*.py netaddr/ip/*.py netaddr/eui/*.idx