mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 00:04:09 +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__()
|
||||
|
||||
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
|
||||
|
||||
def _delegate(op):
|
||||
|
|
Loading…
Reference in New Issue
Block a user