use RecursionError, and provide an alias for RuntimeError for Py2
This commit is contained in:
parent
12ec7f539e
commit
20c93b9fdb
@ -7,7 +7,7 @@ import sys
|
||||
__all__ = ['basestring', 'unicode', 'unichr', 'byteord', 'bytechr', 'BytesIO',
|
||||
'StringIO', 'UnicodeIO', 'strjoin', 'bytesjoin', 'tobytes', 'tostr',
|
||||
'tounicode', 'Tag', 'open', 'range', 'xrange', 'round', 'Py23Error',
|
||||
'SimpleNamespace', 'zip']
|
||||
'SimpleNamespace', 'zip', 'RecursionError']
|
||||
|
||||
|
||||
class Py23Error(NotImplementedError):
|
||||
@ -514,6 +514,12 @@ else:
|
||||
_stream = "stderr"
|
||||
|
||||
|
||||
try:
|
||||
RecursionError = RecursionError
|
||||
except NameError:
|
||||
RecursionError = RuntimeError
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import doctest, sys
|
||||
sys.exit(doctest.testmod().failed)
|
||||
|
@ -843,7 +843,7 @@ class Glyph(object):
|
||||
g = glyfTable[compo.glyphName]
|
||||
try:
|
||||
coordinates, endPts, flags = g.getCoordinates(glyfTable)
|
||||
except RuntimeError:
|
||||
except RecursionError:
|
||||
raise ttLib.TTLibError("glyph '%s' contains a recursive component reference" % compo.glyphName)
|
||||
if hasattr(compo, "firstPt"):
|
||||
# move according to two reference points
|
||||
|
Loading…
x
Reference in New Issue
Block a user