ImageStat: simplify if block

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Ondrej Baranovič 2024-04-16 18:34:48 +02:00 committed by GitHub
parent 8b62538617
commit 2e73bed053
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,9 +52,9 @@ class Stat:
"""
if isinstance(image_or_list, Image.Image):
self.h = image_or_list.histogram(mask)
else:
elif isinstance(image_or_list, list):
self.h = image_or_list
if not isinstance(self.h, list):
else:
msg = "first argument must be image or list" # type: ignore[unreachable]
raise TypeError(msg)
self.bands = list(range(len(self.h) // 256))