Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception with Python 3.7 #168

Merged
merged 3 commits into from
Oct 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
#
# UAVCAN DSDL compiler for libuavcan
#
Expand Down Expand Up @@ -39,11 +40,11 @@ def run(source_dirs, include_dirs, output_dir):
possibly empty list of search directories (containing DSDL definition files that can be referenced from the types
that are going to be parsed), and the output directory path (possibly nonexistent) where the generated C++
header files will be stored.

Note that this module features lazy write, i.e. if an output file does already exist and its content is not going
to change, it will not be overwritten. This feature allows to avoid unnecessary recompilation of dependent object
files.

Args:
source_dirs List of root namespace directories to parse.
include_dirs List of root namespace directories with referenced types (possibly empty). This list is
Expand Down Expand Up @@ -297,7 +298,10 @@ def expand(**args):
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
Expand Down