[varLib.cff]: shouldn't iterate through a dict while deleting keys

cherry-picked from https://github.com/fonttools/fonttools/pull/1415
This commit is contained in:
Cosimo Lupo 2019-01-02 17:31:47 +00:00
parent 1fd9bf6c29
commit 39f49b785b
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482

View File

@ -77,7 +77,7 @@ def lib_convertCFFToCFF2(cff, otFont):
privateOpOrder = buildOrder(privateDictOperators2)
for fontDict in fdArray:
fontDict.setCFF2(True)
for key in fontDict.rawDict.keys():
for key in list(fontDict.rawDict.keys()):
if key not in fontDict.order:
del fontDict.rawDict[key]
if hasattr(fontDict, key):