Merge pull request #2585 from justvanrossum/cmap-minor-cleanup
[cmap] don't handle expected case in exception handler
This commit is contained in:
commit
a293606fc8
@ -177,13 +177,11 @@ class table__c_m_a_p(DefaultTable.DefaultTable):
|
||||
seen = {} # Some tables are the same object reference. Don't compile them twice.
|
||||
done = {} # Some tables are different objects, but compile to the same data chunk
|
||||
for table in self.tables:
|
||||
try:
|
||||
offset = seen[id(table.cmap)]
|
||||
except KeyError:
|
||||
offset = seen.get(id(table.cmap))
|
||||
if offset is None:
|
||||
chunk = table.compile(ttFont)
|
||||
if chunk in done:
|
||||
offset = done[chunk]
|
||||
else:
|
||||
offset = done.get(chunk)
|
||||
if offset is None:
|
||||
offset = seen[id(table.cmap)] = done[chunk] = totalOffset + len(tableData)
|
||||
tableData = tableData + chunk
|
||||
data = data + struct.pack(">HHl", table.platformID, table.platEncID, offset)
|
||||
|
Loading…
x
Reference in New Issue
Block a user