Give more detailed info about exception determining image type.

This commit is contained in:
Georg Brandl 2010-06-12 20:15:13 +02:00
parent 9a0859fea8
commit 43c0c87136

View File

@ -818,9 +818,10 @@ class BuildEnvironment:
imgtype = imghdr.what(f)
finally:
f.close()
except (OSError, IOError):
self.warn(docname,
'image file %s not readable' % filename)
except (OSError, IOError), err:
self.warn(docname, 'image file %s not '
'readable: %s' % (filename, err),
node.line)
if imgtype:
candidates['image/' + imgtype] = new_imgpath
else: