Skip to content

Commit 5e0d7cb

Browse files
committed
fix python3 issue
1 parent cbc43f3 commit 5e0d7cb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

misc/tools/gen-metrics-and-svgs.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ def genKerningInfo(ufo, glyphnames, nameToIdMap):
168168

169169
# load groups
170170
filename = os.path.join(ufo.path, 'groups.plist')
171-
groups = plistlib.readPlist(filename)
171+
groups = None
172+
with open(filename, 'rb') as f:
173+
groups = plistlib.load(f)
172174

173175
pairs = []
174176
for kt in kerning.keys():
@@ -177,12 +179,12 @@ def genKerningInfo(ufo, glyphnames, nameToIdMap):
177179
leftnames = []
178180
rightnames = []
179181

180-
if leftname.startswith('public.kern'):
182+
if leftname.startswith(u'public.kern'):
181183
leftnames = groups[leftname]
182184
else:
183185
leftnames = [leftname]
184186

185-
if rightname.startswith('public.kern'):
187+
if rightname.startswith(u'public.kern'):
186188
rightnames = groups[rightname]
187189
else:
188190
rightnames = [rightname]

0 commit comments

Comments
 (0)