Simplify chained comparison

This commit is contained in:
Hugo van Kemenade 2022-04-10 17:50:17 +03:00
parent 935bdfa516
commit 74ccda3aff

View File

@ -222,7 +222,7 @@ def _save_all(im, fp, filename):
if ( if (
not isinstance(background, (list, tuple)) not isinstance(background, (list, tuple))
or len(background) != 4 or len(background) != 4
or not all(v >= 0 and v < 256 for v in background) or not all(0 <= v < 256 for v in background)
): ):
raise OSError( raise OSError(
"Background color is not an RGBA tuple clamped to (0-255): %s" "Background color is not an RGBA tuple clamped to (0-255): %s"