Skip to content

Commit 6932562

Browse files
committed
Added __int__ to IFDRational for Python >= 3.11
1 parent cdf5fd4 commit 6932562

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/PIL/TiffImagePlugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@ def delegate(self, *args):
425425
__ceil__ = _delegate("__ceil__")
426426
__floor__ = _delegate("__floor__")
427427
__round__ = _delegate("__round__")
428+
# Python >= 3.11
429+
if hasattr(Fraction, "__int__"):
430+
__int__ = _delegate("__int__")
428431

429432

430433
class ImageFileDirectory_v2(MutableMapping):

0 commit comments

Comments
 (0)