mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
ImageStat: simplify if block
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
8b62538617
commit
2e73bed053
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user