Add GH#167 patch for PEP479 compat
This commit is contained in:
parent
4fc95a201e
commit
0b1f50e8e3
26
0001-PEP-479-return-instead-of-raise-StopIteration.patch
Normal file
26
0001-PEP-479-return-instead-of-raise-StopIteration.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From 2599f0e57c0a20bd3f8870dbc2c5479cad502597 Mon Sep 17 00:00:00 2001
|
||||
From: Sergey Kozlov <sergey.kozlov@intel.com>
|
||||
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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user