Blob Blame History Raw
From 0e5c8db6965e203b40739914b9714010010ccce0 Mon Sep 17 00:00:00 2001
From: Felix Yan <felixonmars@archlinux.org>
Date: Tue, 3 Jul 2018 03:04:52 +0800
Subject: [PATCH] Fix compatibility for Python 3.7

---
 blist/_sortedlist.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/blist/_sortedlist.py b/blist/_sortedlist.py
index b34f69e..d6143c4 100644
--- a/blist/_sortedlist.py
+++ b/blist/_sortedlist.py
@@ -420,7 +420,10 @@ class _setmixin(object):
     def __iter__(self):
         it = super(_setmixin, self).__iter__()
         while True:
-            item = next(it)
+            try:
+                item = next(it)
+            except StopIteration:
+                return
             n = len(self)
             yield item
             if n != len(self):
-- 
2.18.0.rc2