diff --git a/Lib/fontTools/varLib/cff.py b/Lib/fontTools/varLib/cff.py index a9ac11f12..967fde7c5 100644 --- a/Lib/fontTools/varLib/cff.py +++ b/Lib/fontTools/varLib/cff.py @@ -61,15 +61,16 @@ def lib_convertCFFToCFF2(cff, otFont): fdArray.append(fontDict) fontDict.Private = privateDict privateOpOrder = buildOrder(privateDictOperators2) - for entry in privateDictOperators: - key = entry[1] - if key not in privateOpOrder: - if key in privateDict.rawDict: - # print "Removing private dict", key - del privateDict.rawDict[key] - if hasattr(privateDict, key): - delattr(privateDict, key) - # print "Removing privateDict attr", key + if privateDict is not None: + for entry in privateDictOperators: + key = entry[1] + if key not in privateOpOrder: + if key in privateDict.rawDict: + # print "Removing private dict", key + del privateDict.rawDict[key] + if hasattr(privateDict, key): + delattr(privateDict, key) + # print "Removing privateDict attr", key else: # clean up the PrivateDicts in the fdArray fdArray = topDict.FDArray diff --git a/Lib/fontTools/varLib/instancer.py b/Lib/fontTools/varLib/instancer.py index fd1e82bf0..ddc5173d9 100644 --- a/Lib/fontTools/varLib/instancer.py +++ b/Lib/fontTools/varLib/instancer.py @@ -987,7 +987,7 @@ def parseArgs(args): try: axisLimits = parseLimits(options.locargs) except ValueError as e: - parser.error(e) + parser.error(str(e)) if len(axisLimits) != len(options.locargs): parser.error("Specified multiple limits for the same axis")