diff --git a/generate_emoji_html.py b/generate_emoji_html.py index 09fa8ed03..9516a23e5 100755 --- a/generate_emoji_html.py +++ b/generate_emoji_html.py @@ -181,7 +181,7 @@ def _collect_aux_info(dir_infos, keys): # now we need to invert the map aux_info = collections.defaultdict(set) - for key, index in target_key_to_info_index.iteritems(): + for key, index in target_key_to_info_index.items(): aux_info[index].add(key) return aux_info @@ -352,7 +352,7 @@ def _get_dir_infos( def _add_aliases(keys, aliases): - for k, v in sorted(aliases.iteritems()): + for k, v in sorted(aliases.items()): k_str = unicode_data.seq_to_string(k) v_str = unicode_data.seq_to_string(v) if k in keys: @@ -360,7 +360,7 @@ def _add_aliases(keys, aliases): print('have alias image %s, should use %s%s' % (k_str, v_str, msg)) elif v not in keys: print('can\'t use alias %s, no image matching %s' % (k_str, v_str)) - to_add = {k for k, v in aliases.iteritems() if k not in keys and v in keys} + to_add = {k for k, v in aliases.items() if k not in keys and v in keys} return keys | to_add @@ -399,7 +399,7 @@ def _get_keys(dir_infos, aliases, limit, all_emoji, emoji_sort, ignore_missing): def _generate_info_text(args): - lines = ['%s: %r' % t for t in sorted(args.__dict__.iteritems())] + lines = ['%s: %r' % t for t in sorted(args.__dict__.items())] lines.append('generated by %s on %s' % ( path.basename(__file__), datetime.datetime.now())) return '\n '.join(lines) @@ -546,7 +546,7 @@ def _get_canonical_aliases(): def canon(seq): return unicode_data.get_canonical_emoji_sequence(seq) or seq aliases = add_aliases.read_default_emoji_aliases() - return {canon(k): canon(v) for k, v in aliases.iteritems()} + return {canon(k): canon(v) for k, v in aliases.items()} def _get_canonical_excluded(): def canon(seq):