fix IFDRational equality

This commit is contained in:
luphord 2020-07-24 16:17:15 +02:00 committed by Andrew Murray
parent 9b86da9c26
commit c6c1d7c11a

View File

@ -354,6 +354,9 @@ class IFDRational(Rational):
def __eq__(self, other): def __eq__(self, other):
if isinstance(other, IFDRational): 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
other = other._val other = other._val
return self._val == other return self._val == other