From 18a41fc8df615007624c00322d1d023091646256 Mon Sep 17 00:00:00 2001 From: josch Date: Fri, 13 Mar 2015 14:43:24 +0100 Subject: [PATCH] avoid catch-all except --- src/img2pdf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index c3cf5e1..657a63c 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -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: