mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 14:47:44 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user