summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrej Shadura <andrew.shadura@collabora.co.uk>2018-07-08 09:04:20 +0200
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2018-07-08 09:47:46 +0200
commit6921721f683ae08bd005a2e790dc6e21ec7140fb (patch)
treea4ba24dfc20410d6e730df5f5a99eaa997f9cda8
parentb9a6730284101e232e7340f81b61407e94749675 (diff)
parent74604df9d213e434ce7a6720e771f068b2144211 (diff)
Merge patched into master
-rw-r--r--blist/_sortedlist.py13
-rw-r--r--debian/.git-dpm4
-rw-r--r--debian/patches/0001-Catch-StopIteration-in-a-generator-and-return-instea.patch34
-rw-r--r--debian/patches/series1
4 files changed, 45 insertions, 7 deletions
diff --git a/blist/_sortedlist.py b/blist/_sortedlist.py
index b34f69e..1f77170 100644
--- a/blist/_sortedlist.py
+++ b/blist/_sortedlist.py
@@ -420,11 +420,14 @@ class _setmixin(object):
def __iter__(self):
it = super(_setmixin, self).__iter__()
while True:
- item = next(it)
- n = len(self)
- yield item
- if n != len(self):
- raise RuntimeError('Set changed size during iteration')
+ try:
+ item = next(it)
+ n = len(self)
+ yield item
+ if n != len(self):
+ raise RuntimeError('Set changed size during iteration')
+ except StopIteration:
+ return
def safe_cmp(f):
def g(self, other):
diff --git a/debian/.git-dpm b/debian/.git-dpm
index d1e7e4c..ce09239 100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@ -1,6 +1,6 @@
# see git-dpm(1) from git-dpm package
-ecfc3ba4143115d03622dc947cd7bbf834f76f23
-ecfc3ba4143115d03622dc947cd7bbf834f76f23
+74604df9d213e434ce7a6720e771f068b2144211
+74604df9d213e434ce7a6720e771f068b2144211
ecfc3ba4143115d03622dc947cd7bbf834f76f23
ecfc3ba4143115d03622dc947cd7bbf834f76f23
blist_1.3.6.orig.tar.gz
diff --git a/debian/patches/0001-Catch-StopIteration-in-a-generator-and-return-instea.patch b/debian/patches/0001-Catch-StopIteration-in-a-generator-and-return-instea.patch
new file mode 100644
index 0000000..e8a001b
--- /dev/null
+++ b/debian/patches/0001-Catch-StopIteration-in-a-generator-and-return-instea.patch
@@ -0,0 +1,34 @@
+From 74604df9d213e434ce7a6720e771f068b2144211 Mon Sep 17 00:00:00 2001
+From: Andrej Shadura <andrew.shadura@collabora.co.uk>
+Date: Sun, 8 Jul 2018 09:00:16 +0200
+Subject: Catch StopIteration in a generator and return instead, per PEP 479
+
+Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
+---
+ blist/_sortedlist.py | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/blist/_sortedlist.py b/blist/_sortedlist.py
+index b34f69e..1f77170 100644
+--- a/blist/_sortedlist.py
++++ b/blist/_sortedlist.py
+@@ -420,11 +420,14 @@ class _setmixin(object):
+ def __iter__(self):
+ it = super(_setmixin, self).__iter__()
+ while True:
+- item = next(it)
+- n = len(self)
+- yield item
+- if n != len(self):
+- raise RuntimeError('Set changed size during iteration')
++ try:
++ item = next(it)
++ n = len(self)
++ yield item
++ if n != len(self):
++ raise RuntimeError('Set changed size during iteration')
++ except StopIteration:
++ return
+
+ def safe_cmp(f):
+ def g(self, other):
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..1e0e05f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Catch-StopIteration-in-a-generator-and-return-instea.patch