add identifier parameter to PointToSegmentPen.addComponent method

'identifier' param is part of the AbstractPointPen interface.
Even though it is unused by the segment pen protocol, the caller may attempt
to pass it by positional argument instead of keyword argument, e.g.
2920ddd07c/Lib/fontMath/mathGlyph.py (L486)

this patch avoids the resulting TypeError exception
This commit is contained in:
Cosimo Lupo 2019-02-27 16:30:20 -08:00
parent 2dfb7bf0ff
commit fdb3974dd9

View File

@ -200,7 +200,8 @@ class PointToSegmentPen(BasePointToSegmentPen):
else:
pen.endPath()
def addComponent(self, glyphName, transform, **kwargs):
def addComponent(self, glyphName, transform, identifier=None, **kwargs):
del identifier # unused
self.pen.addComponent(glyphName, transform)