mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +03:00
Lint fixes
This commit is contained in:
parent
6d3fb7b083
commit
74d53bcd15
|
@ -253,7 +253,7 @@ class TestFileTiffMetadata(PillowTestCase):
|
|||
|
||||
# pair of 4 byte signed longs
|
||||
numerator = 2 ** 31 - 1
|
||||
denominator = -2 ** 31
|
||||
denominator = -(2 ** 31)
|
||||
|
||||
info[37380] = TiffImagePlugin.IFDRational(numerator, denominator)
|
||||
|
||||
|
@ -265,7 +265,7 @@ class TestFileTiffMetadata(PillowTestCase):
|
|||
self.assertEqual(denominator, reloaded.tag_v2[37380].denominator)
|
||||
|
||||
# pair of 4 byte signed longs
|
||||
numerator = -2 ** 31
|
||||
numerator = -(2 ** 31)
|
||||
denominator = 2 ** 31 - 1
|
||||
|
||||
info[37380] = TiffImagePlugin.IFDRational(numerator, denominator)
|
||||
|
|
|
@ -544,7 +544,7 @@ class ImageFileDirectory_v2(MutableMapping):
|
|||
elif all(isinstance(v, int) for v in values):
|
||||
if all(0 <= v < 2 ** 16 for v in values):
|
||||
self.tagtype[tag] = TiffTags.SHORT
|
||||
elif all(-2 ** 15 < v < 2 ** 15 for v in values):
|
||||
elif all(-(2 ** 15) < v < 2 ** 15 for v in values):
|
||||
self.tagtype[tag] = TiffTags.SIGNED_SHORT
|
||||
else:
|
||||
self.tagtype[tag] = (
|
||||
|
@ -715,7 +715,7 @@ class ImageFileDirectory_v2(MutableMapping):
|
|||
@_register_writer(10)
|
||||
def write_signed_rational(self, *values):
|
||||
return b"".join(
|
||||
self._pack("2l", *_limit_signed_rational(frac, 2 ** 31 - 1, -2 ** 31))
|
||||
self._pack("2l", *_limit_signed_rational(frac, 2 ** 31 - 1, -(2 ** 31)))
|
||||
for frac in values
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user