commit:     757121ce5abed563609610918426879c3235f60a
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 21 12:18:59 2019 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Apr 21 12:18:59 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=757121ce

dev-python/reportlab: Add patch for >=pillow-6

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../files/reportlab-3.5.13-pillow-VERSION.patch         | 17 +++++++++++++++++
 ...portlab-3.5.13.ebuild => reportlab-3.5.13-r1.ebuild} |  1 +
 2 files changed, 18 insertions(+)

diff --git a/dev-python/reportlab/files/reportlab-3.5.13-pillow-VERSION.patch 
b/dev-python/reportlab/files/reportlab-3.5.13-pillow-VERSION.patch
new file mode 100644
index 00000000000..3b2093d9a8c
--- /dev/null
+++ b/dev-python/reportlab/files/reportlab-3.5.13-pillow-VERSION.patch
@@ -0,0 +1,17 @@
+--- a/src/reportlab/lib/utils.py
++++ b/src/reportlab/lib/utils.py
+@@ -883,7 +883,13 @@
+                     im = self._image
+                     mode = self.mode = im.mode
+                     if mode in ('LA','RGBA'):
+-                        if Image.VERSION.startswith('1.1.7'): im.load()
++                        # Pillow 6.0.0 and above have removed the 'VERSION' 
attribute
++                        # 
https://bitbucket.org/rptlab/reportlab/issues/176/incompatibility-with-pillow-600
++                        try:
++                            im_ver = Image.__version__
++                        except AttributeError:
++                            im_ver = Image.VERSION
++                        if im_ver.startswith('1.1.7'): im.load()
+                         self._dataA = ImageReader(im.split()[3 if 
mode=='RGBA' else 1])
+                         nm = mode[:-1]
+                         im = im.convert(nm)

diff --git a/dev-python/reportlab/reportlab-3.5.13.ebuild 
b/dev-python/reportlab/reportlab-3.5.13-r1.ebuild
similarity index 96%
rename from dev-python/reportlab/reportlab-3.5.13.ebuild
rename to dev-python/reportlab/reportlab-3.5.13-r1.ebuild
index 26d754790dd..77800e21ecc 100644
--- a/dev-python/reportlab/reportlab-3.5.13.ebuild
+++ b/dev-python/reportlab/reportlab-3.5.13-r1.ebuild
@@ -29,6 +29,7 @@ DEPEND="${RDEPEND}
 
 PATCHES=(
        "${FILESDIR}/${PN}-3.5.13-disable-network-tests.patch"
+       "${FILESDIR}/${PN}-3.5.13-pillow-VERSION.patch"
 )
 
 src_unpack() {

Reply via email to