(self)
| 490 | pass |
| 491 | |
| 492 | def load(self) -> Image.core.PixelAccess | None: |
| 493 | loader = self._load() |
| 494 | if loader is None: |
| 495 | msg = f"cannot find loader for this {self.format} file" |
| 496 | raise OSError(msg) |
| 497 | image = loader.load(self) |
| 498 | assert image is not None |
| 499 | # become the other object (!) |
| 500 | self.__class__ = image.__class__ # type: ignore[assignment] |
| 501 | self.__dict__ = image.__dict__ |
| 502 | return image.load() |
| 503 | |
| 504 | @abc.abstractmethod |
| 505 | def _load(self) -> StubHandler | None: |