Added __int__ to IFDRational for Python >= 3.11

This commit is contained in:
Andrew Murray 2023-03-09 22:21:37 +11:00
parent cdf5fd439c
commit 6932562974

View File

@ -425,6 +425,9 @@ class IFDRational(Rational):
__ceil__ = _delegate("__ceil__")
__floor__ = _delegate("__floor__")
__round__ = _delegate("__round__")
# Python >= 3.11
if hasattr(Fraction, "__int__"):
__int__ = _delegate("__int__")
class ImageFileDirectory_v2(MutableMapping):