mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
Reverted NaN change, so that NaN != NaN
This commit is contained in:
parent
4bb35c57dd
commit
0a46cbfea9
|
@ -30,7 +30,6 @@ def test_sanity():
|
|||
|
||||
|
||||
def test_ranges():
|
||||
|
||||
for num in range(1, 10):
|
||||
for denom in range(1, 10):
|
||||
assert IFDRational(num, denom) == IFDRational(num, denom)
|
||||
|
@ -50,12 +49,6 @@ def test_nonetype():
|
|||
assert xres and yres
|
||||
|
||||
|
||||
def test_nan():
|
||||
# usually NaN != NaN, but this would break exif self-equality
|
||||
|
||||
assert IFDRational(123, 0) == IFDRational(123, 0)
|
||||
|
||||
|
||||
def test_ifd_rational_save(tmp_path):
|
||||
methods = (True, False)
|
||||
if not features.check("libtiff"):
|
||||
|
|
|
@ -354,12 +354,8 @@ class IFDRational(Rational):
|
|||
|
||||
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
|
||||
other = other._val
|
||||
return self._val == other
|
||||
|
||||
def _delegate(op):
|
||||
def delegate(self, *args):
|
||||
|
|
Loading…
Reference in New Issue
Block a user