mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 08:14:10 +03:00
fix IFDRational equality
This commit is contained in:
parent
101e8f84b6
commit
78e971913c
|
@ -353,6 +353,12 @@ class IFDRational(Rational):
|
||||||
return self._val.__hash__()
|
return self._val.__hash__()
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
|
if isinstance(other, IFDRational):
|
||||||
|
if self.denominator == 0 and other.denominator == 0:
|
||||||
|
# in this case self._val and other._val would be NaN
|
||||||
|
return self.numerator == other.numerator
|
||||||
|
return self._val == other._val
|
||||||
|
else:
|
||||||
return self._val == other
|
return self._val == other
|
||||||
|
|
||||||
def _delegate(op):
|
def _delegate(op):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user