Skip to content

Commit 126aede

Browse files
committed
Apply ruff autofixes
1 parent dc4f417 commit 126aede

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

src/PIL/GdImageFile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _open(self):
4747
# Header
4848
s = self.fp.read(1037)
4949

50-
if not i16(s) in [65534, 65535]:
50+
if i16(s) not in [65534, 65535]:
5151
msg = "Not a valid GD 2.x .gd file"
5252
raise SyntaxError(msg)
5353

src/PIL/Image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ def alpha_composite(self, im, dest=(0, 0), source=(0, 0)):
17561756
if not isinstance(dest, (list, tuple)):
17571757
msg = "Destination must be a tuple"
17581758
raise ValueError(msg)
1759-
if not len(source) in (2, 4):
1759+
if len(source) not in (2, 4):
17601760
msg = "Source must be a 2 or 4-tuple"
17611761
raise ValueError(msg)
17621762
if not len(dest) == 2:

src/PIL/IptcImagePlugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
import tempfile
1919

2020
from . import Image, ImageFile
21-
from ._binary import i8
21+
from ._binary import i8, o8
2222
from ._binary import i16be as i16
2323
from ._binary import i32be as i32
24-
from ._binary import o8
2524

2625
COMPRESSION = {1: "raw", 5: "jpeg"}
2726

src/PIL/PyAccess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def set_pixel(self, x, y, color):
241241
except TypeError:
242242
color = min(color[0], 65535)
243243

244-
pixel.l = color & 0xFF # noqa: E741
244+
pixel.l = color & 0xFF
245245
pixel.r = color >> 8
246246

247247

@@ -262,7 +262,7 @@ def set_pixel(self, x, y, color):
262262
except Exception:
263263
color = min(color[0], 65535)
264264

265-
pixel.l = color >> 8 # noqa: E741
265+
pixel.l = color >> 8
266266
pixel.r = color & 0xFF
267267

268268

src/PIL/features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def check_module(feature):
2424
:returns: ``True`` if available, ``False`` otherwise.
2525
:raises ValueError: If the module is not defined in this version of Pillow.
2626
"""
27-
if not (feature in modules):
27+
if feature not in modules:
2828
msg = f"Unknown module {feature}"
2929
raise ValueError(msg)
3030

0 commit comments

Comments
 (0)