[ttGlyph] Adjust contextmanager pattern

This commit is contained in:
Behdad Esfahbod 2023-02-02 10:52:31 -07:00
parent e07fafc324
commit f3f50393a8

View File

@ -45,9 +45,10 @@ class _TTGlyphSet(Mapping):
self.location = self.location.copy() self.location = self.location.copy()
self.location.update(location) self.location.update(location)
yield None try:
yield None
self.location = self.locationStack.pop() finally:
self.location = self.locationStack.pop()
def __contains__(self, glyphName): def __contains__(self, glyphName):
return glyphName in self.glyphsMapping return glyphName in self.glyphsMapping