From 0bbfb3b2902cc9b3b404ba5cab6d6a4c6bad9583 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Fri, 5 Jan 2018 13:05:30 +0000 Subject: [PATCH] Typing: Image.frombuffer --- src/PIL/Image.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 8956598d9..23865a325 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -2535,9 +2535,11 @@ def frombuffer(mode, size, data, decoder_name="raw", *args): args = mode, 0, -1 # may change to (mode, 0, 1) post-1.1.6 if args[0] in _MAPMODES: im = new(mode, (1, 1)) + # typing -- Getting this to cleanly realize that args is a + # correctly formatted tuple is harder than it's worth im = im._new( core.map_buffer(data, size, decoder_name, None, 0, args) - ) + ) # type: ignore im.readonly = 1 return im