cater for python-pil versions without close() attribute

main
josch 9 years ago
parent 23b77d2544
commit 486361e716

@ -310,7 +310,11 @@ def convert(images, dpi=None, pagesize=(None, None), title=None, author=None,
imgdata = imgdata.convert('RGB')
color = imgdata.mode
img = imgdata.tobytes()
imgdata.close()
# the python-pil version 2.3.0-1ubuntu3 in Ubuntu does not have the close() method
try:
imgdata.close()
except AttributeError:
pass
imgdata = zlib.compress(img)
im.close()

Loading…
Cancel
Save