SHA256
1
0
forked from pool/meson
meson/Don-t-raise-StopIteration-in-generators-no-longer-al.patch
2018-07-13 06:59:29 +00:00

33 lines
1.1 KiB
Diff

From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Mon, 28 May 2018 09:32:19 +0200
Subject: Don't raise StopIteration in generators, no longer allowed with
Python 3.7. Fixes #3622
Patch-mainline: 0.47.1
Raising StopIteration from a generator has been deprecated with Python 3.5 and is now
an error with Python 3.7: https://docs.python.org/3.8/library/exceptions.html#StopIteration
Just use return instead.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
mesonbuild/compilers/compilers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 762e7c56..56a0ab2b 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -796,7 +796,7 @@ class Compiler:
mlog.debug('Cached compiler stdout:\n', p.stdo)
mlog.debug('Cached compiler stderr:\n', p.stde)
yield p
- raise StopIteration
+ return
try:
with tempfile.TemporaryDirectory() as tmpdirname:
if isinstance(code, str):
--
2.12.3