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.
pull/3644/head
Christoph Reiter 7 years ago committed by Jussi Pakkanen
parent 64906b0755
commit a87496addd
  1. 2
      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):

Loading…
Cancel
Save