fix UFOFormatVersion tuple's __str__ in python 3.11
python 3.11 doesn't like when a mixin overrides a dunder method like __str__, for some reasons it keep using Enum.__str__, see https://github.com/fonttools/fonttools/pull/2655
This commit is contained in:
parent
ce38db6562
commit
5ca57917c6
@ -98,6 +98,11 @@ class UFOFormatVersion(tuple, _VersionTupleEnumMixin, enum.Enum):
|
||||
FORMAT_2_0 = (2, 0)
|
||||
FORMAT_3_0 = (3, 0)
|
||||
|
||||
# python 3.11 doesn't like when a mixin overrides a dunder method like __str__
|
||||
# for some reasons it keep using Enum.__str__, see
|
||||
# https://github.com/fonttools/fonttools/pull/2655
|
||||
UFOFormatVersion.__str__ = _VersionTupleEnumMixin.__str__
|
||||
|
||||
|
||||
class UFOFileStructure(enum.Enum):
|
||||
ZIP = "zip"
|
||||
|
@ -79,6 +79,9 @@ class GLIFFormatVersion(tuple, _VersionTupleEnumMixin, enum.Enum):
|
||||
versions.add(cls.FORMAT_2_0)
|
||||
return frozenset(versions)
|
||||
|
||||
# workaround for py3.11, see https://github.com/fonttools/fonttools/pull/2655
|
||||
GLIFFormatVersion.__str__ = _VersionTupleEnumMixin.__str__
|
||||
|
||||
|
||||
# ------------
|
||||
# Simple Glyph
|
||||
|
Loading…
x
Reference in New Issue
Block a user