mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Use "not in"
Co-authored-by: Aarni Koskela <akx@iki.fi>
This commit is contained in:
parent
8f3ccff8f2
commit
c24c1ccf81
|
@ -47,7 +47,7 @@ class GdImageFile(ImageFile.ImageFile):
|
||||||
# Header
|
# Header
|
||||||
s = self.fp.read(1037)
|
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"
|
msg = "Not a valid GD 2.x .gd file"
|
||||||
raise SyntaxError(msg)
|
raise SyntaxError(msg)
|
||||||
|
|
||||||
|
|
|
@ -1731,7 +1731,7 @@ class Image:
|
||||||
if not isinstance(dest, (list, tuple)):
|
if not isinstance(dest, (list, tuple)):
|
||||||
msg = "Destination must be a tuple"
|
msg = "Destination must be a tuple"
|
||||||
raise ValueError(msg)
|
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"
|
msg = "Source must be a 2 or 4-tuple"
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
if not len(dest) == 2:
|
if not len(dest) == 2:
|
||||||
|
|
|
@ -24,7 +24,7 @@ def check_module(feature):
|
||||||
:returns: ``True`` if available, ``False`` otherwise.
|
:returns: ``True`` if available, ``False`` otherwise.
|
||||||
:raises ValueError: If the module is not defined in this version of Pillow.
|
: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}"
|
msg = f"Unknown module {feature}"
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user