Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make_ct_known_logs_list.py: Make Python 3 compatible
In Python 3 keys() returns an iterable instead of a list. It's necessary to explicitly convert when you want to use as a list. Still works with Python 2. Fixed errors: Traceback (most recent call last): File "../../components/certificate_transparency/tools/make_ct_known_logs_list.py", line 204, in <module> sys.exit(main()) File "../../components/certificate_transparency/tools/make_ct_known_logs_list.py", line 199, in main generate_cpp_file(infile, outfile) File "../../components/certificate_transparency/tools/make_ct_known_logs_list.py", line 174, in generate_cpp_file if _is_log_once_or_currently_qualified(log): File "../../components/certificate_transparency/tools/make_ct_known_logs_list.py", line 161, in _is_log_once_or_currently_qualified return log.get("state").keys()[0] not in ("pending", "rejected") TypeError: 'dict_keys' object is not subscriptable Traceback (most recent call last): File "C:\Google\chromium\src\components\certificate_transparency\tools\make_ct_known_logs_list_unittest.py", line 238, in testSortingAndFilteringDisqualifiedLogs disqualified_logs = make_ct_known_logs_list._sorted_disqualified_logs(logs) File "C:\Google\chromium\src\components\certificate_transparency\tools\make_ct_known_logs_list.py", line 147, in _sorted_disqualified_logs return sorted( File "C:\Google\chromium\src\components\certificate_transparency\tools\make_ct_known_logs_list.py", line 87, in _is_log_disqualified log_state = log.get("state").keys()[0] TypeError: 'dict_keys' object is not subscriptable Bug: 941669 Change-Id: Iff905a290c3dc2581e1a0ff7ad8a8282ce9c050e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857121 Reviewed-by: Ryan Sleevi <rsleevi@chromium.org> Commit-Queue: Raul Tambre <raul@tambre.ee> Auto-Submit: Raul Tambre <raul@tambre.ee> Cr-Commit-Position: refs/heads/master@{#705592}
- Loading branch information