Skip to content

Commit 2309f0f

Browse files
committed
Inherit classes with abstractmethod from ABC
1 parent 7552893 commit 2309f0f

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/PIL/BlpImagePlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def _open(self) -> None:
291291
self.tile = [ImageFile._Tile(decoder, (0, 0) + self.size, offset, args)]
292292

293293

294-
class _BLPBaseDecoder(ImageFile.PyDecoder):
294+
class _BLPBaseDecoder(abc.ABC, ImageFile.PyDecoder):
295295
_pulls_fd = True
296296

297297
def decode(self, buffer: bytes | Image.SupportsArrayInterface) -> tuple[int, int]:

src/PIL/Image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,7 @@ def toqpixmap(self) -> ImageQt.QPixmap:
29662966
# Abstract handlers.
29672967

29682968

2969-
class ImagePointHandler:
2969+
class ImagePointHandler(abc.ABC):
29702970
"""
29712971
Used as a mixin by point transforms
29722972
(for use with :py:meth:`~PIL.Image.Image.point`)
@@ -2977,7 +2977,7 @@ def point(self, im: Image) -> Image:
29772977
pass
29782978

29792979

2980-
class ImageTransformHandler:
2980+
class ImageTransformHandler(abc.ABC):
29812981
"""
29822982
Used as a mixin by geometry transforms
29832983
(for use with :py:meth:`~PIL.Image.Image.transform`)

src/PIL/ImageFile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def _seek_check(self, frame: int) -> bool:
438438
return self.tell() != frame
439439

440440

441-
class StubHandler:
441+
class StubHandler(abc.ABC):
442442
def open(self, im: StubImageFile) -> None:
443443
pass
444444

src/PIL/ImageFilter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from ._typing import NumpyArray
2828

2929

30-
class Filter:
30+
class Filter(abc.ABC):
3131
@abc.abstractmethod
3232
def filter(self, image: _imaging.ImagingCore) -> _imaging.ImagingCore:
3333
pass

src/PIL/ImageShow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def show_file(self, path: str, **options: Any) -> int:
192192
register(MacViewer)
193193

194194

195-
class UnixViewer(Viewer):
195+
class UnixViewer(abc.ABC, Viewer):
196196
format = "PNG"
197197
options = {"compress_level": 1, "save_all": True}
198198

0 commit comments

Comments
 (0)