Blame a87496addd9160300837aa50193f4798c6f1d251.patch

Miro Hrončok 1e0bf7
From a87496addd9160300837aa50193f4798c6f1d251 Mon Sep 17 00:00:00 2001
Miro Hrončok 1e0bf7
From: Christoph Reiter <reiter.christoph@gmail.com>
Miro Hrončok 1e0bf7
Date: Mon, 28 May 2018 09:32:19 +0200
Miro Hrončok 1e0bf7
Subject: [PATCH] Don't raise StopIteration in generators, no longer allowed
Miro Hrončok 1e0bf7
 with Python 3.7. Fixes #3622
Miro Hrončok 1e0bf7
Miro Hrončok 1e0bf7
Raising StopIteration from a generator has been deprecated with Python 3.5 and is now
Miro Hrončok 1e0bf7
an error with Python 3.7: https://docs.python.org/3.8/library/exceptions.html#StopIteration
Miro Hrončok 1e0bf7
Miro Hrončok 1e0bf7
Just use return instead.
Miro Hrončok 1e0bf7
---
Miro Hrončok 1e0bf7
 mesonbuild/compilers/compilers.py | 2 +-
Miro Hrončok 1e0bf7
 1 file changed, 1 insertion(+), 1 deletion(-)
Miro Hrončok 1e0bf7
Miro Hrončok 1e0bf7
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
Miro Hrončok 1e0bf7
index 762e7c569..56a0ab2b8 100644
Miro Hrončok 1e0bf7
--- a/mesonbuild/compilers/compilers.py
Miro Hrončok 1e0bf7
+++ b/mesonbuild/compilers/compilers.py
Miro Hrončok 1e0bf7
@@ -796,7 +796,7 @@ def compile(self, code, extra_args=None, mode='link', want_output=False):
Miro Hrončok 1e0bf7
                 mlog.debug('Cached compiler stdout:\n', p.stdo)
Miro Hrončok 1e0bf7
                 mlog.debug('Cached compiler stderr:\n', p.stde)
Miro Hrončok 1e0bf7
                 yield p
Miro Hrončok 1e0bf7
-                raise StopIteration
Miro Hrončok 1e0bf7
+                return
Miro Hrončok 1e0bf7
         try:
Miro Hrončok 1e0bf7
             with tempfile.TemporaryDirectory() as tmpdirname:
Miro Hrončok 1e0bf7
                 if isinstance(code, str):