Skip to content

Commit

Permalink
Don't raise StopIteration in generators, no longer allowed with Pytho…
Browse files Browse the repository at this point in the history
…n 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.
  • Loading branch information
lazka authored and jpakkane committed May 29, 2018
1 parent 64906b0 commit a87496a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/compilers/compilers.py
Expand Up @@ -796,7 +796,7 @@ def compile(self, code, extra_args=None, mode='link', want_output=False):
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):
Expand Down

0 comments on commit a87496a

Please sign in to comment.