Skip to content

Commit deb5a78

Browse files
committed
Use "not in"
1 parent 599979c commit deb5a78

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

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
@@ -1731,7 +1731,7 @@ def alpha_composite(self, im, dest=(0, 0), source=(0, 0)):
17311731
if not isinstance(dest, (list, tuple)):
17321732
msg = "Destination must be a tuple"
17331733
raise ValueError(msg)
1734-
if not len(source) in (2, 4):
1734+
if len(source) not in (2, 4):
17351735
msg = "Source must be a 2 or 4-tuple"
17361736
raise ValueError(msg)
17371737
if not len(dest) == 2:

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)