cater for python-pil versions without close() attribute (the 2nd fix)

This commit is contained in:
josch 2015-03-07 03:01:02 +01:00
parent 486361e716
commit b90e385efe

View file

@ -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((