improve error message

This commit is contained in:
justvanrossum 2019-03-17 15:35:35 +01:00
parent ac2413e905
commit 12ec7f539e
2 changed files with 2 additions and 2 deletions

View File

@ -844,7 +844,7 @@ class Glyph(object):
try: try:
coordinates, endPts, flags = g.getCoordinates(glyfTable) coordinates, endPts, flags = g.getCoordinates(glyfTable)
except RuntimeError: except RuntimeError:
raise ttLib.TTLibError("glyph '%s' contains recursive component reference" % compo.glyphName) raise ttLib.TTLibError("glyph '%s' contains a recursive component reference" % compo.glyphName)
if hasattr(compo, "firstPt"): if hasattr(compo, "firstPt"):
# move according to two reference points # move according to two reference points
x1,y1 = allCoords[compo.firstPt] x1,y1 = allCoords[compo.firstPt]

View File

@ -237,7 +237,7 @@ class glyfTableTest(unittest.TestCase):
glyph_B = pen_B.glyph() glyph_B = pen_B.glyph()
glyphSet["A"] = glyph_A glyphSet["A"] = glyph_A
glyphSet["B"] = glyph_B glyphSet["B"] = glyph_B
with self.assertRaisesRegex(TTLibError, "glyph '.' contains recursive component reference"): with self.assertRaisesRegex(TTLibError, "glyph '.' contains a recursive component reference"):
glyph_A.getCoordinates(glyphSet) glyph_A.getCoordinates(glyphSet)