forked from josch/img2pdf
avoid catch-all except
This commit is contained in:
parent
4968d58621
commit
18a41fc8df
1 changed files with 2 additions and 3 deletions
|
@ -233,11 +233,10 @@ def convert(images, dpi=None, pagesize=(None, None, None), title=None,
|
|||
debug_out("Reading %s"%imfilename, verbose)
|
||||
try:
|
||||
rawdata = imfilename.read()
|
||||
im = cStringIO(rawdata)
|
||||
except:
|
||||
except AttributeError:
|
||||
with open(imfilename, "rb") as im:
|
||||
rawdata = im.read()
|
||||
im = cStringIO(rawdata)
|
||||
im = cStringIO(rawdata)
|
||||
try:
|
||||
imgdata = Image.open(im)
|
||||
except IOError as e:
|
||||
|
|
Loading…
Reference in a new issue