From b90e385efedff229c1de21d9d365b65422c32528 Mon Sep 17 00:00:00 2001 From: josch Date: Sat, 7 Mar 2015 03:01:02 +0100 Subject: [PATCH] cater for python-pil versions without close() attribute (the 2nd 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 3508baf..08ff69a 100644 --- a/src/tests/__init__.py +++ b/src/tests/__init__.py @@ -93,7 +93,11 @@ def test_suite(): with open(out, "rb") as outf: out = outf.read() self.assertEqual(pdf, out) - orig_img.close() + # the python-pil version 2.3.0-1ubuntu3 in Ubuntu does not have the close() method + try: + orig_img.close() + except AttributeError: + pass setattr(TestImg2Pdf, "test_%s"%test_name, handle) return unittest.TestSuite((