From d5fc324b7bd4087764e7e713093412587c2bdd60 Mon Sep 17 00:00:00 2001 From: josch Date: Sat, 7 Mar 2015 03:02:00 +0100 Subject: [PATCH] cater for python-pil versions without close() attribute (the 3rd fix) --- src/tests/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tests/__init__.py b/src/tests/__init__.py index 08ff69a..15c9328 100644 --- a/src/tests/__init__.py +++ b/src/tests/__init__.py @@ -87,7 +87,11 @@ def test_suite(): elif orig_img.mode not in ("RGB", "L", "CMYK", "CMYK;I"): orig_img = orig_img.convert("RGB") self.assertEqual(im.tobytes(), orig_img.tobytes()) - im.close() + # the python-pil version 2.3.0-1ubuntu3 in Ubuntu does not have the close() method + try: + im.close() + except AttributeError: + pass # lastly, make sure that the generated pdf matches bit by bit the # expected pdf with open(out, "rb") as outf: