mypy: Clarify xml.find use in build_emoji:code_point_to_file_name_map.

This commit is contained in:
neiljp (Neil Pilgrim) 2017-08-10 12:57:11 -07:00 committed by Tim Abbott
parent 4b709de9c9
commit a059872856
1 changed files with 3 additions and 1 deletions

View File

@ -144,7 +144,9 @@ def code_point_to_file_name_map(ttx):
"""
result = {} # type: Dict[int, Union[Text, bytes]]
xml = ET.parse(ttx)
for elem in xml.find("*cmap_format_12"):
cmap = xml.find("*cmap_format_12")
assert cmap is not None
for elem in cmap:
code_point = int(elem.attrib["code"], 16)
fname = elem.attrib["name"]
result[code_point] = fname