Fix scheduler compatibility with Python 3.7 harder

Always catch StopIteration, rather than allowing it to bubble up a level.
This is neccessary due to PEP0479, wherein it was decided that Python will
start converting this exception to a RuntimeError when it bubbles up,
beginning with Python 3.7.

This is a follow-up to f7edd0ba2d, which
missed one case of where StopIteration could be raised.

Change-Id: I34bc32e7477bcaa0ddfe30179f1008b1be97c0a3
This commit is contained in:
Zane Bitter 2016-02-10 22:51:58 -05:00
parent 9d47ee0d0b
commit 3c96f5a084
1 changed files with 4 additions and 1 deletions

View File

@ -318,7 +318,10 @@ def wrappertask(task):
parent.close()
raise
except: # noqa
subtask = parent.throw(*sys.exc_info())
try:
subtask = parent.throw(*sys.exc_info())
except StopIteration:
return
else:
try:
subtask = next(parent)