Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "not in" #7174

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/PIL/GdImageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _open(self):
# Header
s = self.fp.read(1037)

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

Expand Down
2 changes: 1 addition & 1 deletion src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ def alpha_composite(self, im, dest=(0, 0), source=(0, 0)):
if not isinstance(dest, (list, tuple)):
msg = "Destination must be a tuple"
raise ValueError(msg)
if not len(source) in (2, 4):
if len(source) not in (2, 4):
msg = "Source must be a 2 or 4-tuple"
raise ValueError(msg)
if not len(dest) == 2:
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def check_module(feature):
:returns: ``True`` if available, ``False`` otherwise.
:raises ValueError: If the module is not defined in this version of Pillow.
"""
if not (feature in modules):
if feature not in modules:
msg = f"Unknown module {feature}"
raise ValueError(msg)

Expand Down