Commit 60378204 authored by Sarthak Kukreti's avatar Sarthak Kukreti Committed by Commit Bot

cpplint: use list() for working with python3

In python3, dict.keys() returns a view instead of a separate
dictionary, which results in the following error while trying
to use cpplint:

"RuntimeError: dictionary changed size during iteration"

Use a list of the keyset instead.

R=ehmaldonado@chromium.org

Bug: 1027160
Change-Id: I0040b8912d7e446d35d755bb021670c9f2248f4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1966743Reviewed-by: 's avatarMike Frysinger <vapier@chromium.org>
Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Sarthak Kukreti <sarthakkukreti@chromium.org>
parent a33af223
......@@ -5433,7 +5433,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
# include_dict is modified during iteration, so we iterate over a copy of
# the keys.
header_keys = include_dict.keys()
header_keys = list(include_dict.keys())
for header in header_keys:
(same_module, common_path) = FilesBelongToSameModule(abs_filename, header)
fullpath = common_path + header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment