diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-05-28 09:32:19 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-05-29 21:58:49 +0300 |
commit | a87496addd9160300837aa50193f4798c6f1d251 (patch) | |
tree | 189d8ec4f7328ade258118eae6066a892cda0750 | |
parent | 64906b07557acf828806f1d1f7c67a2ca05cf103 (diff) | |
download | meson-a87496addd9160300837aa50193f4798c6f1d251.zip meson-a87496addd9160300837aa50193f4798c6f1d251.tar.gz meson-a87496addd9160300837aa50193f4798c6f1d251.tar.bz2 |
Don't raise StopIteration in generators, no longer allowed with Python 3.7. Fixes #3622
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.
-rw-r--r-- | mesonbuild/compilers/compilers.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 762e7c5..56a0ab2 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): |