dsdl_compiler: check for StopIteration exception

This fixes the exception happening with Python 3.7.

I'm assuming this has to do with:
https://www.python.org/dev/peps/pep-0479/
This commit is contained in:
Julian Oes 2018-10-04 08:44:48 +02:00
parent 65d1f61d9b
commit 90ae14efcd

View File

@ -298,7 +298,10 @@ def make_template_expander(filename):
def enum_last_value(iterable, start=0):
it = iter(iterable)
count = start
last = next(it)
try:
last = next(it)
except StopIteration:
return
for val in it:
yield count, False, last
last = val