From 50a36dbb5287d2b1a44325bf05a5196523d53def Mon Sep 17 00:00:00 2001
From: ansable <anchous12@gmail.com>
Date: Tue, 4 Jun 2019 10:57:54 +0200
Subject: [PATCH] PEP 479

otherwise numerous tests are failing
---
 pattern/metrics.py       | 6 +++---
 pattern/text/__init__.py | 2 +-
 pattern/web/__init__.py  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pattern/metrics.py b/pattern/metrics.py
index d3abca0a..e075024c 100644
--- a/pattern/metrics.py
+++ b/pattern/metrics.py
@@ -666,7 +666,7 @@ def _multiple(v, round=False):
         a, b = 0, a
     if a == b:
         yield float(a)
-        raise StopIteration
+        return
     r = _multiple(b - a)
     t = _multiple(r / (n - 1), round=True)
     a = floor(a / t) * t
@@ -1077,7 +1077,7 @@ def _gs(a, x, epsilon=3.e-7, iterations=700):
             s = s + d
             if abs(d) < abs(s) * epsilon:
                 return (s * exp(-x + a * log(x) - ln), ln)
-        raise StopIteration(abs(d), abs(s) * epsilon)
+        return
 
     # Continued fraction approximation.
     def _gf(a, x, epsilon=3.e-7, iterations=200):
@@ -1099,7 +1099,7 @@ def _gf(a, x, epsilon=3.e-7, iterations=200):
                 if abs((g - g0) / g) < epsilon:
                     return (g * exp(-x + a * log(x) - ln), ln)
                 g0 = g
-        raise StopIteration(abs((g - g0) / g))
+        return
 
     if a <= 0.0:
         return 1.0
diff --git a/pattern/text/__init__.py b/pattern/text/__init__.py
index aa77af0b..5e4c1108 100644
--- a/pattern/text/__init__.py
+++ b/pattern/text/__init__.py
@@ -606,7 +606,7 @@ def _read(path, encoding="utf-8", comment=";;;"):
             if not line or (comment and line.startswith(comment)):
                 continue
             yield line
-    raise StopIteration
+    return
 
 
 class Lexicon(lazydict):
diff --git a/pattern/web/__init__.py b/pattern/web/__init__.py
index c76cea88..745f1c45 100644
--- a/pattern/web/__init__.py
+++ b/pattern/web/__init__.py
@@ -2384,7 +2384,7 @@ def index(self, namespace=0, start=None, count=100, cached=True, **kwargs):
                     yield x[id]
             start = data.get("query-continue", {}).get("allpages", {})
             start = start.get("apcontinue", start.get("apfrom", -1))
-        raise StopIteration
+        return
 
     # Backwards compatibility.
     list = index
@@ -2909,7 +2909,7 @@ def articles(self, **kwargs):
                 for x in (data or {}).get("pages", {}).values():
                     yield WikiaArticle(title=x.get("title", ""), source=x.get("html", ""))
                 if done:
-                    raise StopIteration
+                    return
         for title in self.index(**kwargs):
             yield self.search(title, **kwargs)
 
