aboutsummaryrefslogtreecommitdiff
path: root/blist-stopiteration.patch
diff options
context:
space:
mode:
authorEfraim Flashner2021-12-06 09:31:12 +0200
committerEfraim Flashner2021-12-06 09:31:12 +0200
commit8bbe629faaf1e1ccf42c9d6b368d6f11716019ea (patch)
treee629495cf73d0d55912c907ab0fe4105aac18b41 /blist-stopiteration.patch
parenta167712ba9a0c2e096dc953cf3d677fb859bd755 (diff)
downloadguix-bioinformatics-8bbe629faaf1e1ccf42c9d6b368d6f11716019ea.tar.gz
gn: Add mutation-simulator
Diffstat (limited to 'blist-stopiteration.patch')
-rw-r--r--blist-stopiteration.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/blist-stopiteration.patch b/blist-stopiteration.patch
new file mode 100644
index 0000000..198bef4
--- /dev/null
+++ b/blist-stopiteration.patch
@@ -0,0 +1,36 @@
+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>
+
+Forwarded: https://github.com/DanielStutzbach/blist/pull/92
+Bug-Debian: https://bugs.debian.org/902757
+---
+ 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):