From 16ea5504d904d55ae34571d118c133fc5a5b79b9 Mon Sep 17 00:00:00 2001 From: XueDx Date: Wed, 16 Aug 2017 17:18:58 +0800 Subject: [PATCH] update expand and frombytes for Python 2.7 --- qrencode.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qrencode.pyx b/qrencode.pyx index 39ec774..a3a7c8e 100644 --- a/qrencode.pyx +++ b/qrencode.pyx @@ -1,5 +1,5 @@ -from ImageOps import expand -from Image import fromstring +from PIL.ImageOps import expand +from PIL.Image import frombytes cdef extern from "qrencode.h": @@ -75,6 +75,6 @@ cdef class Encoder: rawdata += lines # create PIL image w/ border - image = expand(fromstring('L', (realwidth, realwidth), rawdata), border, 255) + image = expand(frombytes('L', (realwidth, realwidth), rawdata), border, 255) return image