Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 275038b

Browse files
authored
make fidl_gen_cpp work with python3 (#473)
1 parent fc82ca4 commit 275038b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

build/fuchsia/fidl_gen_cpp.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ def main():
6161
args.json
6262
]
6363

64-
for _, fidl_files in fidl_files_by_name.iteritems():
64+
# Create an iterator that works on both python3 and python2
65+
try:
66+
fidl_files_by_name_iter = fidl_files_by_name.items()
67+
except AttributeError:
68+
fidl_files_by_name_iter = fidl_files_by_name.iteritems()
69+
70+
for _, fidl_files in fidl_files_by_name_iter:
6571
fidlc_command.append('--files')
6672
for fidl_file in fidl_files:
6773
fidl_abspath = os.path.abspath('%s/%s' % (args.sdk_base, fidl_file))

0 commit comments

Comments
 (0)