From cf043ed16e631455637cc0a97c557badbb13a4b7 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sun, 20 Aug 2017 10:44:43 -0700 Subject: [PATCH] Type annotations: Correct pixel_access & specify self.readonly. --- PIL/_imaging.pyi | 2 +- src/PIL/Image.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PIL/_imaging.pyi b/PIL/_imaging.pyi index a8f20fe14..f5d691c7c 100644 --- a/PIL/_imaging.pyi +++ b/PIL/_imaging.pyi @@ -37,7 +37,7 @@ class ImagingCore: def getpixel(self, xy: XY) -> Optional[Any]: ... def putpixel(self, xy: XY, value: Any) -> None: ... - def pixel_access(self, readonly: bool) -> Any: ... + def pixel_access(self, readonly: int) -> Any: ... def convert(self, mode, dither, paletteimage): ... def convert2(self): ... ### diff --git a/src/PIL/Image.py b/src/PIL/Image.py index d5238209c..e36c711dc 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -553,7 +553,7 @@ class Image(object): self.palette = None # type: Optional[ImagePalette.ImagePalette] self.info = {} # type: Dict[Text, Any] self.category = NORMAL - self.readonly = 0 + self.readonly = 0 # type: int self.pyaccess = None @property